GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Structures
Go To First  |  Previous Question  |  Next Question 
 Data Structures  |  Question 158 of 195    Print  
what is the size of a void pointer ?

  
Total Answers and Comments: 7 Last Update: March 11, 2008     Asked by: anupam verma 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 06, 2006 07:02:19   #1  
digitalgenius Member Since: December 2006   Contribution: 2    

RE: what is the size of a void pointer ?
Size if a void pointer is equal to the size of a char pointer. Even though they point to the data types of different sizes!!!
 
Is this answer useful? Yes | No
January 27, 2007 21:38:59   #2  
vishnu        

RE: what is the size of a void pointer ?
All pointers are of the same size. The size of which depends on the machine - 64/32 bits
 
Is this answer useful? Yes | No
February 06, 2007 06:23:11   #3  
sivanesh.a Member Since: December 2006   Contribution: 190    

RE: what is the size of a void pointer ?
All pointers are of size 2 bytes...(in turbo C)..
 
Is this answer useful? Yes | No
February 21, 2007 23:07:32   #4  
Ankit Bandyopadhyay        

what is the size of a void pointer ?
Actually size of a pointer is fixed,it is 1word.Now 1 word is defined in dos as 2 bytes,but in windows it is 4 bytes.
 
Is this answer useful? Yes | No
July 26, 2007 03:41:38   #5  
Ashwan        

RE: what is the size of a void pointer ?

2 Bytes

 
Is this answer useful? Yes | No
December 28, 2007 05:34:02   #6  
manishmodgil Member Since: July 2006   Contribution: 15    

RE: what is the size of a void pointer ?
The size of any pointer variable is same. ( 2 byte in case of 32 bit machine ).

The type of pointer defines the type of data the pointer is pointing to .

eg. if the pointer is definde as

int *p;

then it will create a pointer p ( of two bytes ) which is pointing to a data of type int ( again of 2 byte ) .

If we create

float *pf;

it will create a pointer ( again of 2 bytes ) but pointing to a float ( of 4 byte ).

The difference makes sense when we try to read or move to the next block etc.

suppose we created a char type pointer to an int then while reading, it will just read the first byte leaving the second byte of int thus giving us wrong output.

 
Is this answer useful? Yes | No
March 11, 2008 10:02:54   #7  
as_hmr Member Since: April 2007   Contribution: 3    

RE: what is the size of a void pointer ?
Yes pointer size is always that of size of word on a particular architecture.

Actually pointer only contains starting address of a data type, there after how many bytes we have to read (e.g. 1 for char, 2 for int) depends upon type of pointer declared.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape