C Programming - Pointers - Discussion
Discussion Forum : Pointers - True / False Questions (Q.No. 3)
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
Explanation:
This program will NOT report any error. (Tested in Turbo C under DOS and GCC under Linux)
The output: 10.000000
The output: 10.000000
Discussion:
23 comments Page 3 of 3.
Kunal Bansal said:
1 decade ago
@kranthi this is an valid prototype
error is because of different thing , read my previous comment
error is because of different thing , read my previous comment
Kranthi said:
1 decade ago
No, Its an error. How come you declare a variable with Void prototype. Void means nothing.
Vivek said:
1 decade ago
This is right program. No error will be there.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers