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  >  Programming  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 218 of 437    Print  
Between a long pointer and a char pointer , which one consumes more memory? explain

  
Total Answers and Comments: 8 Last Update: July 07, 2008     Asked by: Raji 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 23, 2006 01:41:23   #1  
Mridul        

RE: Between a long pointer and a char pointer , which ...
Long pointer consumes more memory as it can go beond the memory limit of 1K. So more address, more space.
 
Is this answer useful? Yes | No
June 24, 2006 02:08:57   #2  
kannan        

RE: Between a long pointer and a char pointer , which ...

NO doubt in this...

always pointer variable is going to store a memory location.... its not a matter its long or char or int or any thing...

so this two is taking same amount of memory.


 
Is this answer useful? Yes | No
July 04, 2006 06:33:42   #3  
krishna reddy        

which occupies more memory either longpointer or charpointer

Both will consume same amount of memory.why because they  means long or char pointer always stores the address of the character or long integer .

Thanks for reading my opinion.


 
Is this answer useful? Yes | No
July 07, 2006 08:15:17   #4  
aruneshwar        

RE: Between a long pointer and a char pointer , which ...

Whatever may be the pointer (whether it points to char, int or float) the memory allocated is same i.e, 2 bytes


 
Is this answer useful? Yes | No
July 19, 2006 12:42:08   #5  
vignesh007 Member Since: July 2006   Contribution: 4    

RE: Between a long pointer and a char pointer , which ...

1) As We All Know That Pointer(*) Holds Address!

2) Address is Always INTEGER (2-Bytes)

3) Hence, 2-Bytes Are Allocated For Any Data Types!

vignesh007@msn.com - Vignesh  980 13 15 15

 


 
Is this answer useful? Yes | No
August 20, 2006 06:58:40   #6  
shaanxxx        

RE: Between a long pointer and a char pointer , which ...
pragmatic approach is the best approach. Just to support above comment.printf("%d",sizeof(long *));printf("%d",sizeof(char *));printf("%d",sizeof(double *));
 
Is this answer useful? Yes | No
August 20, 2006 12:44:32   #7  
Hinstings Member Since: August 2006   Contribution: 4    

RE: Between a long pointer and a char pointer , which ...
I think pointers take 4 bytes in a 4GB virtual memory space, which is true for most of the OS in nowadays.
 
Is this answer useful? Yes | No
July 07, 2008 06:44:51   #8  
jintojos Member Since: May 2008   Contribution: 29    

RE: Between a long pointer and a char pointer , which one consumes more memory? explain
Both the long pointer and char pointer consumes the same memory.
By declaring variable as a long pointer means that it contains the address of another long variable and also for char pointers, it contains the address of another char variable.
So all normal pointers have only two bytes for storing the address. 

 
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