size of char pointer or int pointer

Discussion in 'C Programming' started by theshubham, Sep 10, 2012.

  1. theshubham

    theshubham

    Joined:
    Sep 10, 2012
    Messages:
    2
    main()
    {
    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.
    theshubham, Sep 10, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Schnoffos
    Replies:
    2
    Views:
    1,198
    Martien Verbruggen
    Jun 27, 2003
  2. trey

    newbie: char* int and char *int

    trey, Sep 10, 2003, in forum: C Programming
    Replies:
    7
    Views:
    397
    Irrwahn Grausewitz
    Sep 10, 2003
  3. Hal Styli
    Replies:
    14
    Views:
    1,615
    Old Wolf
    Jan 20, 2004
  4. dddddddd2444444@yahoo.co.uk
    Replies:
    6
    Views:
    305
    Old Wolf
    Mar 14, 2005
  5. gert
    Replies:
    20
    Views:
    1,140
Loading...

Share This Page