|
|
|
Exercise"Time and tide wait for none."
- Alexander Pope
|
| 1. |
Are the expression *ptr++ and ++*ptr are same? |
Answer: Option C
Explanation:
*ptr++ increments the pointer and not the value, whereas the ++*ptr increments the value being pointed by ptr
|
| 2. |
Will the program compile?
#include<stdio.h>
int main()
{
char str[5] = "IndiaBIX";
return 0;
}
|
Answer: Option B
Explanation:
C doesn't do array bounds checking at compile time, hence this compiles.
But, the modern compilers like Turbo C++ detects this as 'Error: Too many initializers'.
GCC would give you a warning.
|
| 3. |
The following program reports an error on compilation.
#include<stdio.h>
int main()
{
float i=10, *j;
void *k;
k=&i;
j=k;
printf("%f\n", *j);
return 0;
}
|
Answer: Option A
Explanation:
This program will NOT report any error. (Tested in Turbo C under DOS and GCC under Linux)
The output: 10.000000
|
| 4. |
Are the three declarations char **apple, char *apple[], and char apple[][] same? |
Answer: Option D
Explanation:
No answer description available for this question. Let us discuss.
|
|
|