Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is void pointer?



what is void pointer?..

Answer / himaja

pointers can also be declared as void type.void pointers cant be dereferenced without explict type conversion,this is becoz being void the compiler cnt determine the size of object that pointer points to,though void vaariables declared is not allowed,thus void p displays error msg "size of p is unknown or 0" after compilation
#include<stdio.h>
int p;
float d;
char c;
void *pt=&p;
void main(void)
{
clrscr();
*(int*)pt=12;
printf("\n p=%d",p);
pt=&d; /*pt points to d*/
*(float*)pt=5.4;
printf("\n r=%f",d);
pt=&c; /*pt points to c*/
*(char*)pt=H;
printf("\n c=%c",c);


o/p:
P=12
R=5.4
C=H

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C Interview Questions

int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

0 Answers  


which type of aspect you want from the student.

0 Answers   IBM, TCS,


#include <stdio.h> int main() { if ("X" <"x") printf("X smaller than x "); } my question is whats the mistake in this program? find it and please tell me..

3 Answers  


can we implement multi-threads in c.

0 Answers  


for(i=0;i=printf("Hello");i++); printf("Hello"); how many times how will be printed?????????

8 Answers  


What are the keywords in c?

0 Answers  


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

0 Answers  


what is difference between overriding and overloading?

1 Answers  


How can I find the modification date of a file?

0 Answers   Celstream,


what is different between auto and local static? why should we use local static?

0 Answers  


Why is C language being considered a middle level language?

0 Answers  


code for selection sort?

1 Answers  


Categories