C Programming - Pointers - Discussion
Discussion Forum : Pointers - Find Output of Program (Q.No. 10)
10.
What will be the output of the program ?
#include<stdio.h>
int main()
{
void *vp;
char ch=74, *cp="JACK";
int j=65;
vp=&ch;
printf("%c", *(char*)vp);
vp=&j;
printf("%c", *(int*)vp);
vp=cp;
printf("%s", (char*)vp+2);
return 0;
}
Discussion:
84 comments Page 9 of 9.
Kalpesh suryswst said:
4 years ago
Thanks @Nilesh.
Khalid said:
4 years ago
@Nilesh.
Thank you for explaining.
Thank you for explaining.
Har said:
2 years ago
Thank you for your explanation @Nilesh.
Abdul said:
3 weeks ago
@Nilesh.
Thank you very much, you explained it very clearly.
Thank you very much, you explained it very clearly.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers