Chapter 5 Pointers and strings 1. Pointers are variables that contain as their values addresses of other variables. 2. The only integer that can be assigned to an pointer is 0. 3. The address operator (&) returns the address of its operand. 4. The operand od an address operator must be a variable name. 5. The dereferencing operator (*) returns a synonym, alias, or nickname for the name of the object that its operand points to in memory. 6. If you want the called function to modify the parameters passed, then pass them by call-by-reference, then use dereference operator (*) to modify the value of the arguments in the calling function. 7. A function receiving an address as an argument must include a pointer as its corresponding parameter. 8. It is not necessary to include the names of pointers in function prototypes. It is only necessary to include the data types of pointers in function prototypes. 9. The const qualifier enables the programmer to inform the compiler that the value of a particular variable should not be modified. 10. Arrays are automatically passed by reference using pointers because the value of the array name is the address of the first element of the array. 11. Operator sizeof can be applied to data type, variable, and constant. 12. Pointer arithmetic ar done element by element, instead of byte by byte. 13. Pointer can be subscripted exactly as array names can. 14. In pointer/offset notation, the offset is the same as an array subscript. 15. An array name is a pointer constant which always point to the first element of the array. 16. A pointer to a function is the address where the code for the function resides. 17. Pointer to functions can be passed to functions, returned from the functions, stored in arrays, and assigned to other pointers. 18. A common use of the function pointers is in so called menu-driven system. The function pointers are used to select which function to call for a particular menu item. 19. You must include string.h when you use the string functions. 20. The string in C++ is an array of character ended with a null (0) character. 21. A sequence of calls to strtok breaks a string into tokens that are separated by characters contained in a second string argument. A pointer to the current token is returned by each call. If there are no more tokens when strtok is called, NULL is returned. 22. Function strlen takes a string as an argument, and returns the number of characters in the string -- the terminating null character is not included in the length of the string. 23. Dereferencing a pointer that has not been properly initialized, or that has not been assigned to point to a specific location in memory, could cause a fatal execution error, or it could accidentally modify important data and allow the program to run to completion providing incorrect results. 24. The strcmp and strncmp will return 0 when the strings are equal. 25. Dereferencing a NULL (0) pointer is normally a fatal execution time error. 26. Before using a function, check its function prototype to terminate the parameters that it can modify. 27. Character and string are totally different objects in C++. 28. It is you who have to make sure enough space is allocated for string functions. 29. Pointers are among C++'s most difficult capabilities to master. 30. Pointer enable the programs to simulate call-by-reference, to create and manipulate dynamic data structures, i.e., data structures that can grow and shrink, such as linked lists, queues, stacks, and trees.