Flashcards in Final Deck (39):
T/F? A pointer variable must be declared specific to the data type of the variable whose address will be assigned to it.
T/F? A pointer has as its value a signed integer that is allocated four bytes of storage.
T/F? To assign the address of a variable to a pointer variable an address operator must be used.
T/F? To access the contents of a variable through a pointer variable, the pointer variable must be assigned the memory address of the variable first, and then the pointer must be dereferenced.
T/F? A pointer variable has no data type of its own.
T/F? A pointer variable must contain an unsigned integer so it cannot point to a character string.
T/F? A pointer variable must not be assigned a scalar constant.
T/F? A pointer variable can be added to another pointer variable.
T/F? A pointer variable can be subtracted from another pointer variable.
T/F? A pointer variable can be used to change the address of an array.
T/F? Two pointer variable can point to the same variable.
T/F? An array name is an address variable.
T/F? The address of an array is found as either the array name or the explicit address of the first element of the array.
T/F? The elements of a one-dimensional array may be accessed by dereferencing the offset address only once.
T/F? To input data to an array using a pointer variable, the name of the array may be used to specify the address of the array elements.
T/F? To input data to an array using pointer variable, the name of the array may be used to specify the address of the array elements.
T/F? Arithmetic operations may be performed by using an array name without dereferencing the name.
T/F? An array can be copied y assigning the address to a pointer variable.
T/F? The dynamic storage allocation functions are in the sodlib.h header file in C.
T/F? To allocate a block of storage at the time of execution of the program, dynamic storage allocation functions are used.
T/F? The pointer tot he dynamic storage returned by calloc() must be cast to the data type it is pointing to.
T/F? When a dynamic pointer is incremented by one, the address is incremented by the number of bytes of the data type it is pointing to.
T/F? When a dynamic pointer is incremented, the address of the dynamic pointer variable will change.
Write the code to declare a dynamic pointer and allocate storage to store a one-dimensional array of 200 elements and data type int.
ptr = (int *) calloc(200, sizeof(int));
Write the code to declare a dynamic pointer and allocate storage to store a one-dimensional array of 80,000 elements of data type float.
ptr = (float *) calloc(80000, size of(float));
Write a program to declare a dynamic pointer and allocate storage to store a two-dimensional array of 50 x 60 of data type float. Also write the code to input data to the dynamic array and output the data from the dynamic array.
ptr = (float *) calloc(50 * 60, sizeof(float));
ptr = ptr - 3000;
for(k = 0; k < 3000; k++)
T/F? If there is not much variability in length of the character strings they may be stored in smooth arrays.
T/F? To store strings with large variability in their length, dynamic storage should be used.
T/F? The dynamic storage allocation function malloc() may be used to allocate storage to store strings.
T/F? A particular structure is a derived data type derived from the basic and derived data types.
T/F? When a structure is declared without a structure tag, a storage template is set up to allocate storage for the structure variables.
T/F? When a structure is declared without a tag, the structure variables must be declared in the structure declaration statement itself.
T/F? When a structure is declared with a structure tag the programmer has a choice of declaring the structure variables in the structure declaration itself or in a separate statement using the structure tag.
T/F? Structure variables may be initialized in the structure declaration statement itself.
T/F?Structure variables may be assigned values by using assignment statements.
Structure variable members may be assigned values by computations.
Structure variables may be elements of an array.
Structure variables are manipulated by using the member operator.