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  >  Placement Papers  >  TCS  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 84 of 87    Print  
If we declare a pointer like char *p;
how much memory is allocated for pointer variable 'p'.

  
Total Answers and Comments: 2 Last Update: February 15, 2007     Asked by: pavankishore 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: winny gupta
 
2 bytes of memory because the pointer variable, whatever data type it maybe pointing to is always an unsigned integer as the address is always a positive integer, hence requiring 2 bytes of memory

Above answer was rated as good by the following members:
ratneshict
December 01, 2006 23:26:04   #1  
Hema        

RE: If we declare a pointer like char *p;how muc...
It will allocate two bytes of memory
 
Is this answer useful? Yes | No
February 15, 2007 08:44:39   #2  
winny gupta Member Since: February 2007   Contribution: 8    

RE: If we declare a pointer like char *p;how muc...
2 bytes of memory because the pointer variable, whatever data type it maybe pointing to is always an unsigned integer as the address is always a positive integer, hence requiring 2 bytes of memory
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Which of the following about automatic variables within a function is correct ?a.its type must be declared before using the variableb.they are localc.they are not initialised to zerod.they are global.

A memory of 20 bytes is allocated to a string declared as char *sthen the following two statements are executed:s="Etrance"l=strlen(s);what is the value of l ?a.20b.8c.9d.21

Consider the following structure:struct num nam{int no;char name[25];};struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};..........printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);What does the above statement print?a.8,9b.9,9c.8,8d.8,unpredictable value

Regarding the scope of the varibles;identify the incorrect statement:a.automatic variables are automatically initialised to 0b.static variables are are automatically initialised to 0c.the address of a register variable is not accessiabled.static variables cannot be initialised with any expression

Which of the following statements is incorrecta.typedef struct new{int n1;char n2;} DATA;b.typedef struct {int n3;char *n4; }ICE;c.typedef union {int n5;float n6;} UDT;d.#typedef union {int n7;float n8;} TUDAT;

Which of the following about automatic variables within a function is correct?A. Its type must be declared before using the variableB. They are localC. They are not initialized to zeroD. They are global

Latest Answer : '9' is a charecter constant ...

Latest Answer : string.anything within inverted commas is a string. ...

Latest Answer : float ...

A memory of 20 bytes is allocated to a string declared as char *s then the following two statements are executed:s="Entrance"l=strlen(s);what is the value of l ?A. 20B. 8C. 9D. 21


 Sponsored Links

 
Related Articles

C++ Memory Management operators

C Memory Management operators Need for Memory Management operators The concept of arrays has a block of memory reserved The disadvantage with the concept of arrays is that the programmer must know while programming the size of memory to be allocated in addition to the array size remaining constant m
 

C++ Void Pointer and Null Pointer

C Void Pointer and Null Pointer In this C tutorial you will learn about two interesting types of pointers; void pointers and Null Pointer These pointers will be discussed in conjunction with syntax usage and example mosgoogle center Pointer to Void General Syntax void pointer variable; Void is use
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

What happens when a variable is not declared in function definition?

Generally in C program the function definition and calling takes the form as given below: main() { int x,y,z; z=sample(x,y); printf(“%d”,z); } sample(x1,y1) int x1,y1; { int z1; z1= x1 - y1; return(z1); } Here what happens is the values x, y gets passed to x1,y1
 

Variable, Constants and Data types in C++

Variable Constants and Data types in C In this C tutorial you will learn about variable constants and data types in C rules for defining variable name short int int long int float double long double char bool declaring variables and constants mosgoogle Variables A variable is the storage location in
 

How Consistent Practice Can Help You Improve Your Memory

How Consistent Practice Can Help You Improve Your Memory Researchers have known for a long time that learning a skill in set intervals is the best way to master it Instead of teaching someone a large number of things at once they learn better when the information is split apart in sections mosgoogle
 

Intelligence and Memory

Intelligence and Memory If you wish to improve your memory you will also need to understand the nature of intelligence Intelligence is currently broken down into two categories and these are crystallized intelligence and fluid intelligence mosgoogle Crystallized intelligence deals with the brain pro
 

The Foundation of Memory

The Foundation of Memory Many people who are interested in improving their memories will often want to understand its foundation You may have also wandered if the emotion of a person will have an effect on their memory mosgoogle This a complex concept that does not have simple answers because emotio
 

Understanding Your Memory

Understanding Your Memory While there are a number of different techniques you can use to improve your memory it is important to know which techniques are best for a given situation While one technique may be good for a specific situation it may be worthless for another mosgoogle Knowing which techn
 

Tips You Can Use To Improve Your Memory

Tips You Can Use To Improve Your Memory When it comes to our general memory we tend to receive the data before we analyze and store it into our brains Much of this information is stored in a form that is called short term memory To improve your memory you will want to take the desirable parts of thi
 

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