Hema
Answered On : Dec 1st, 2006
It will allocate two bytes of memory

3 Users have rated as useful.
Login to rate this answer.
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

5 Users have rated as useful.
Login to rate this answer.
int, float, or char any pointer variable takes 2bytes of memory..

1 User has rated as useful.
Login to rate this answer.
it will take 2 bytes coz pointer store address which r of type int

1 User has rated as useful.
Login to rate this answer.
2 bytes.. because p will contain an address, which is 'int'
Login to rate this answer.
pointer store address so it will require 2 byte
Login to rate this answer.
The answer will vary by platform. It could be as little as 2 bytes or more than 8. On the systems I work with, it's typically 4 bytes.
Login to rate this answer.
bhanu
Answered On : Aug 24th, 2011
Code
#include<stdio.h>
#include<conio.h>
void main()
{
char *p;
}
Login to rate this answer.
janani
Answered On : Aug 25th, 2011
thus 32 bits are allocated if we declare a char *p;
Login to rate this answer.
r.rubiya
Answered On : Aug 26th, 2011
char2
Login to rate this answer.
Akshaya
Answered On : Aug 27th, 2011
2 bytes
Login to rate this answer.
anusha
Answered On : Aug 28th, 2011
Two bytes of memory
Login to rate this answer.
pooja
Answered On : Aug 30th, 2011
1 byte
Login to rate this answer.
& address is of the type integer, it can't be a character or a float.
& Integer takes two bytes to store So answer would be 2bytes.
Login to rate this answer.
maggi
Answered On : Sep 3rd, 2011
2 bytes
Login to rate this answer.
suman
Answered On : Sep 3rd, 2011
*p means there is no certain amount of memory allocated for that it will take what data you give and there is no limitation like up to this size. There is no waste of memory.
Login to rate this answer.
navatha
Answered On : Sep 7th, 2011
2
Login to rate this answer.
shafi
Answered On : Sep 7th, 2011
depends on the data types....but this answer is 1 byte....
Login to rate this answer.
shiva
Answered On : Sep 10th, 2011
1 byte
Login to rate this answer.
ronak
Answered On : Sep 10th, 2011
2 bytes of memory will be allocated, as pointer always point to the unsigned integer as address are unsigned integer.
Login to rate this answer.
SHILPA
Answered On : Sep 23rd, 2011
it will take 2 bytes. because pointer always take 2 bytes
Login to rate this answer.
anupama
Answered On : Sep 25th, 2011
one byte
Login to rate this answer.
Avinash Chourasiya
Answered On : Nov 12th, 2011
2 bytes
Login to rate this answer.
I know Ive answered this already, but I thought Id include a handy macro definition for getting the size of any type (pointer or otherwise) on your platform (see code insert). FWIW, here are the results on my system (Linux 2.4.20, gcc compiler in C99 mode):
Size of char = 1
Size of char * = 4
Size of unsigned char = 1
Size of unsigned char * = 4
Size of short = 2
Size of short * = 4
Size of unsigned short = 2
Size of unsigned short * = 4
Size of long = 4
Size of long * = 4
Size of unsigned long = 4
Size of unsigned long * = 4
Size of long long = 8
Size of long long * = 4
Size of unsigned long long = 8
Size of unsigned long long * = 4
Size of float = 4
Size of float * = 4
Size of double = 8
Size of double * = 4
Size of long double = 12
Size of long double * = 4
Size of struct {char a; char b; long y;} = 8
Size of struct {long y; char a; char b;} = 8
Size of struct {char a; char b; long y;} * = 4
Size of union {char a; char b; long y;} = 4
Size of union {char a; char b; long y;} * = 4
Code
#include <stdio.h>
#if defined(__STDC__)
#if defined(__STDC_VERSION__)
#if __STDC_VERSION__ >= 199901L
#define C99 1
#endif
#endif
#endif
#ifdef C99
#define fmt "%zu"
#define cast
#else
#define fmt "%lu"
#define cast (unsigned long)
#endif
#define PRINT_SIZE(t) printf("Size of %-30s = " fmt "
", #t, cast sizeof(t))
int main(void)
{
PRINT_SIZE(char);
PRINT_SIZE(char *);
PRINT_SIZE(unsigned char);
PRINT_SIZE(unsigned char *);
PRINT_SIZE(short);
PRINT_SIZE(short *);
PRINT_SIZE(unsigned short);
PRINT_SIZE(unsigned short *);
PRINT_SIZE(long);
PRINT_SIZE(long *);
PRINT_SIZE(unsigned long);
PRINT_SIZE(unsigned long *);
#ifdef C99
PRINT_SIZE(long long);
PRINT_SIZE(long long *);
PRINT_SIZE(unsigned long long);
PRINT_SIZE(unsigned long long *);
#endif
PRINT_SIZE(float);
PRINT_SIZE(float *);
PRINT_SIZE(double);
PRINT_SIZE(double *);
#ifdef C99
PRINT_SIZE(long double);
PRINT_SIZE(long double *);
#endif
PRINT_SIZE(struct {char a; char b; long y;});
PRINT_SIZE(struct {long y; char a; char b;});
PRINT_SIZE(struct {char a; char b; long y;} *);
PRINT_SIZE(union {char a; char b; long y;});
PRINT_SIZE(union {char a; char b; long y;} *);
return 0;
}
Login to rate this answer.
rasmita sahoo
Answered On : May 17th, 2012
2 byte for tc & 4 byte for gcc compiler
Login to rate this answer.
reetu
Answered On : Sep 30th, 2012
It allocate 2bytes in memory
Login to rate this answer.