CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • sristi

    MemberJan 21, 2007

    i guesso/p will be 2 and 1since printf executes 4m left to right ..sizeof('a') =1 byte..sizeof a char and sizeof(a)=2 bytes
    Are you sure? This action cannot be undone.
    Cancel
  • pad

    MemberJan 24, 2007

    ish_nalini
    what is the o/p:

    char a='a';
    printf("%d %d",sizeof(a),sizeof('a'));

    answer is architecture dependant.

    sizeof (datatype) are always architecture dependant.... unless you use virtual machines like JVM.
    Are you sure? This action cannot be undone.
    Cancel
  • mahul

    MemberNov 15, 2007

    yeah pad is right this gotta depend on compiler and architecture
    Are you sure? This action cannot be undone.
    Cancel
  • Yamini L

    MemberMar 23, 2008

    i think it would be 2 and 1...for int 2bytes and for char 1 byte...that also depends on the architecture of ur system
    Are you sure? This action cannot be undone.
    Cancel
  • ambuja 28

    MemberMar 27, 2008

    we cant write sizeof() inside printf .so it 'll give error
    Are you sure? This action cannot be undone.
    Cancel
  • sattu21

    MemberMar 28, 2008

    the answer wud be
    1 1
    Are you sure? This action cannot be undone.
    Cancel
  • pallavi agarwal

    MemberMar 29, 2008

    according 2 me the answer wud be 1 1 & also there is no need to give char a='a' ,we can simply give char a coz thats not making any difference basically.
    Are you sure? This action cannot be undone.
    Cancel
  • friendster7

    MemberMar 30, 2008

    the answer will be 1 and 1 too.and we can write sizeof() in printf their will be no error.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register