Made with ScholarlyMake flashcards like these from your own notes
Question:What is a pointer?
Answer:A variable that contains the memory address of another variable
Question:What is the address of a variable?
Answer:The specific location where a variable is stored in memory
Question:What is the contents of a variable pointed by the pointer?
Answer:The value stored in the memory location that the pointer is pointing to
Question:What is the syntax for pointer declaration?
Answer:Type * pointer name;
Question:What is the syntax for pointer initialization?
Answer:Type* pointer_name = &variable_name;, Type* pointer_name = NULL;
Question:How do you access a value through a pointer?
Answer:Using the * operator
Question:How do you pass pointers to functions?
Answer:Declare function parameters as pointer type
Question:How do you return pointers from functions?
Answer:Declare function return type as a pointer type
Question:What are void pointers?
Answer:Pointers that can point to other variables of any type
Question:What are pointers to constants?
Answer:Pointers that point to a value that must not be changed
Question:What are constant pointers?
Answer:Pointers whose address stored in the pointer cannot be changed, but the value pointed by the constant pointer can be changed