CSE 230 Study Guide - Final Guide: Sqr, Gnu Compiler Collection, Quicksort

43 views5 pages

Document Summary

#include: preprocessor directive to include another file at the current point in the program, #include file. h locate file. h in current directory (can use a full unix path name, #include locate file. h in standard include directory (usually /usr/include) #define: preprocessor directive that replaces every occurrence of the specified identifier by the replacement string in the remainder of the file. Example: macro that finds the maximum of 3 values. #define max3(x,y,z) max(max(x,y),z: if #define cannot fit on one line, use backslash at end of first line to continue macro on next line, to view results of preprocessor without compilation: gcc -e file. c. /* in main(): */ greeting(hello world: #define x(i) x ## i. Conditional compilation: allows certain sections of code to be compiled if a condition is met, #define debug. #endif: #if ndef(pi) float pi = 3. 141592; More conditional compilation(cont"d: prevent multiple inclusion of header. Assert: generally used for debugging to test preconditions, assert is a macro (see page 389)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions