Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > size of char pointer or int pointer

Thread Tools

size of char pointer or int pointer

theshubham theshubham is offline
Junior Member
Join Date: Sep 2012
Posts: 2
char *s1,*s2;
printf("%d %d ", sizeof(s1),sizeof(s2));

Answer of this question is 2 ,2
and if we replace char *s1 , *s2 with int *s1, *s2 then also the answer is 2 ,2 .

Why this is so??
the size of char is 1 byte and int is 2 byte.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
int urldecode(char *src, char *last, char *dest) gert C Programming 20 02-16-2007 11:28 PM
(const char *cp) and (char *p) are consistent type, (const char **cpp) and (char **pp) are not consistent lovecreatesbeauty C Programming 1 05-09-2006 08:01 AM
int main(int argc, char *argv[] ) vs int main(int argc, char **argv ) Hal Styli C Programming 14 01-20-2004 10:00 PM
newbie: char* int and char *int trey C Programming 7 09-10-2003 03:24 AM
dirty stuff: f(int,int) cast to f(struct{int,int}) Schnoffos C Programming 2 06-27-2003 03:13 AM