GNG 1106 Lecture Notes - Lecture 4: C Mathematical Functions, Logical Disjunction, C Preprocessor
Document Summary
Special characters char int float double struct void typedef type typename type *name ww. yyezz ww. yyezz. Single line comment type fncname(type1, type2, ); type fncname(type1 name1, type2 name2, ) Structure type definition type name[rdim1][cdim2]; type *name type *f() { } Determine size in bytes name. member name->member (type) sizeof typedef struct. Unary and assignment operators evaluated right-to-left, all others left-to-right. Flow constructions if instruction while instruction for instruction do/while instruction return expr if(expr) instr_block else if(expr) instr_block else instr_block while(expr) instr_block for(expr1; expr2; expr3) instr_block do instr_block while (expr); Is char printing char except space, letter, digit. Is char white space (space, formfeed, newline, cr, tab, vtab) Convert to upper case isalnum(c) isapha(c) iscntrl(c) isdigit(c) isprint(c) isgraph(c) ispunct(c) isspace(c) isupper(c) islower(c) tolower(c) toupper(c) Address of first c in s strchr(s, c) Convert string s to integer srand(n) atof(s) atoi(s) Numbers given in parentheses are typical values for the constants. Smallest x so 1. 0 + x 1. 0.