Outline for May 20, 2002 Handouts: Binary Tree Reading: Johnsonbaugh and Kalin, pp. 679-702 (appendix of useful functions) 1. Greetings and felicitations! 2. Directory functions a. DIR *, struct dirent (#include ) b. opendir, readdir, closedir 3. Example program: binary tree 4. Libraries a. compiling with libraries b. common libraries: stdio, ctype 5. Standard I/O Library (#include ) a. open file: fopen b. unstructured read/write: getchar, fgetc (getc), putchar, fputc (putc) c. formatted read/write: fgets (gets), fscanf, fputs (puts), fprintf d. structured read/write: fread, fwrite e. random access: fseek, ftell, rewind f. close file: fclose g. miscellaneous: feof, ferror, clearerr 6. Character types and conversions (#include ) a. alphabetics, numerics, alphanumerics: isalnum, ialdigit, isxdigit, isalpha b. ypper, lower, and conversions: isupper, islower, toupper, tolower c. types of chars: iscntrl, isgraph (not blank, printable), isprint (printable), ispunct, isspace 7. String conversion (#include ) a. string to number: atoi, atof, atol 8. String functions (#include ) a. compare: strcmp, strncmp, strcasecmp, strncasecmp; memcmp b. copy: strcpy, strncpy; memcpy (no overlap), memmove (overlap okay) c. find character: strchr (index), strrchr (rindex), strpbrk; memchr d. length: strlen 9. Memory management (#include a. Allocation: malloc, calloc b. Release: free, cfree (deprecated) c. Reallocation: realloc() 10. Miscellaneous a. terminate program (exit); include b. sort array of data (qsort); include c. time of day (time, ctime); include d. execute cvommand (system); include