T A pointer variable that has not been initialized is called a null pointer. T The new operator dynamically allocates memory. T When used as function parameters, references variables are much easier to work with than pointers. F only increment/decrements, adding or subtracting of integer, and subtracting a pointer from a pointer Pointers may be compared using the relational operators. F Any mathematical operation, including multiplication and division, may be performed on a pointer. T You can change the address that an array names point to. THe address operator is not needed to assign an array's address to a pointer. When you add a value to a pointer, you are actually adding that number times the size of the data type referenced by the pointer. T Array names cannot be dereferenced with the indirection operator. F the * is the indirection operator the &is the memory operator The & operator references a pointer F the * operator dereferences a pointer When the indirection operator is used with a pointer variable, you are actually working with the value the pointer is pointing to. T The & symbol is called the indirection operator. F it is the & operator Pointer variables are designed to hold addresses. T The *operator is used to get the address of a variable. NEW Each byte of memory is assigned a unique address. DELETE You should only use pointers with delete that were previously used with_. NULL When a program is finished with a chunk of dynamically allocated memory, it should free it with the _operator. 0 or NULL A pointer that contains the address 0 is called a _pointer. New Under older compilers, if the new operator cannot allocate the amount of memory requested, it returns_. Dynamic Memory Allocations The_operator is used to dynamically allocate memory. Pointers Creating variables while a program is running is called_. *(indirection) Array names can be used as _ and vice versa. Pointer The_ operator can be used to work with the variable a pointer points to. %(Memory operator) _variables are designed to hold addresses. Each byte in memory is assigned a unique_ Address The_operator can be used to determine a variable's address. Cannot be changed to point to anything else while the function is executing. The parameter will be initialized with the address that is passed as an argument into it.ī. What are two advantages of declaring a pointer parameter as a constant pointer? A. A pointer to a dynamically allocated chunk of memory What is the difference between a pointer to a constant and a constant pointer? Pointer to a constant- a pointer points to a constant value, it cannot change any values inside the constant.Ĭonstant pointer- once the pointer is initialized with an address, it cannot point to anything else. a pointer to an item that was passed into the function as an argumentī. What is the purpose of the delete operator? Free the memory that was created by the new operator Under what circumstances can you successfully return a pointer from a function? A.
0 Comments
Leave a Reply. |