ExamLookup
Menu mobile
Home
Current Affairs
General Knowledge
Computer
Python
HTML
MCQ C - POINTERS MCQ Questions
English
Hindi
Question No. -
11
Report Bug
Which of the following declaration is not supported by C?
Which of the following declaration is not supported by C?
A.
String str;
String str;
B.
char *str;
char *str;
C.
float str = 3e2;
float str = 3e2;
D.
Both String str; & float str = 3e2;
Both String str; & float str = 3e2;
Explanation
It is legal in Java, but not in C.
Question No. -
12
Report Bug
Which of the following declaration is illegal?
Which of the following declaration is illegal?
A.
char *str = “Best C programming classes by Sanfoundry”;
char *str = “Best C programming classes by Sanfoundry”;
B.
char str[] = “Best C programming classes by Sanfoundry”;
char str[] = “Best C programming classes by Sanfoundry”;
C.
char str[20] = “Best C programming classes by Sanfoundry”;
char str[20] = “Best C programming classes by Sanfoundry”;
D.
char[] str = “Best C programming classes by Sanfoundry”;
char[] str = “Best C programming classes by Sanfoundry”;
Explanation
char[] str is a declaration in Java, but not in C.
Question No. -
13
Report Bug
Which of the following expression is equivalent to ++*ptr?
Which of the following expression is equivalent to ++*ptr?
A.
(*ptr)++
(*ptr)++
B.
++*(ptr)
++*(ptr)
C.
(ptr)*++
(ptr)*++
D.
(ptr)++*
(ptr)++*
Question No. -
14
Report Bug
In C, if you pass an array as an argument to a function, what actually gets passed?
In C, if you pass an array as an argument to a function, what actually gets passed?
A.
Value of elements in array
Value of elements in array
B.
First element of the array
First element of the array
C.
Base address of the array
Base address of the array
D.
Address of the last element of array
Address of the last element of array
Question No. -
15
Report Bug
Which of the following functions is used to free the allocated memory?
Which of the following functions is used to free the allocated memory?
A.
remove(var-name);
remove(var-name);
B.
free(var-name);
free(var-name);
C.
delete(var-name);
delete(var-name);
D.
dalloc(var-name);
dalloc(var-name);
Explanation
The function free() is used to de-allocate the memory allocated by the functions malloc ( ), calloc ( ), etc, and return it to heap so that it can be used for other purposes. The argument of the function free ( ) is the pointer to the memory which is to be freed.
Question No. -
16
Report Bug
The expression a[0] and *a[0] are same for int a[100].
The expression a[0] and *a[0] are same for int a[100].
A.
TRUE
सही
B.
FALSE
गलत
Question No. -
17
Report Bug
With every use of a memory allocation function, what function should be used to release allocated memory which is no longer needed?
With every use of a memory allocation function, what function should be used to release allocated memory which is no longer needed?
A.
unalloc()
unalloc()
B.
Dropmem()
Dropmem()
C.
Dealloc()
Dealloc()
D.
free()
free()
Question No. -
18
Report Bug
Size of a pointer is equal to the data type it points to.
Size of a pointer is equal to the data type it points to.
A.
TRUE
सही
B.
FALSE
गलत
Question No. -
19
Report Bug
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable.
If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable.
A.
‘.’
‘.’
B.
‘&’
‘&’
C.
‘*’
‘*’
D.
‘->’
‘->’
Question No. -
20
Report Bug
NULL pointer is not same as an uninitialized pointer.
NULL pointer is not same as an uninitialized pointer.
A.
TRUE
सही
B.
FALSE
गलत
Explanation
In case, if we don't have address to be assigned to a pointer, then we can simply use NULL. NULL vs Uninitialized pointer – An uninitialized pointer stores an undefined value. A null pointer stores a defined value, but one that is defined by the environment to not be a valid address for any member or object.
1
2
3
4
5
6
CCC Online Test 2021
CCC Practice Test Hindi
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
O Level NIELIT Study material and Quiz
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Exam Quiz
Website development Company in Allahabad