NEW
Font size
Worksheetspointers and structures
Total questions: 10
Worksheet time: 9mins
What is the output of following program?
20
30
Compile Error
Runtime Error
Arrays always occupy contiguous memory area
True
False
Which of the following format specifier in printf is used to print pointers?
%c
%d
%f
%p
A pointer is
A keyword used to create variables
A variable that stores address of an instruction
A variable that stores address of a varaibe
All of the above
What is the & in pointers?
Dereferences the memory address into an object
References an object into a memory address
Makes a new copy of the object as a memory address
None of the above.
How do you make a pointer point to an existing variable?
int y = 0;
int *x = y;
int x = y;
int *x = &y;
int &x = *y;
#include <stdio.h> double i; int main() { printf("%g\n",i); return 0; }
0
0.000000
Garbage value
Depends on the compiler
User-defined data type can be derived by___________
struct
enum
typedef
all of the mentioned
Which operator connects the structure name to its member name?
–
<-
.
Both <- and .
Which of the following cannot be a structure member?
Another structure
Function
Array
None of the mentioned
