Discussion Outline
Session 10
Current material
- Strings
- What is a string ? - A character array where the end of the
string is marked with the null terminator. Show internal
representation.
- Assignment operator can only be used during initialization.
- Functions in the string library:
- String length: strlen()
- String copy: strcpy()
- String compare: strcmp()
- String concatenation: strcat()
- I/O functions
- stdin, stdout, stderr
- Use fprintf(stderr, ".....\n"); for all error messages
- getc, fgetc, scanf, fscanf, gets, fgets
- Pointers to structures
- The -> operator
- Structs should be passed to functions by reference, not value.
- Structs that have pointers to structs as members.
- Self-referencing structs
Administrative