main()
{
printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3));
}

Answer Posted / karen

It is theoretically possible for the answer to vary
depending on characteristics of the system. This is why it
is always best to use sizeof instead of assuming the size
of a datatype. This line is equivalent to:

printf("\n %d %d %d",sizeof(char),sizeof(char[2]),sizeof
(int));

The middle is char[2] because it contains 3 and \0.

On my x86 windows 7 system, this program outputs 1 2 4.
Your numbers may be different due to system architecture
differences.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the total generic pointer type?

715


which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2381


Write the test cases for checking a variable having value in range -10.0 to +10.0?

1811


Explain how do you use a pointer to a function?

634


List the difference between a 'copy constructor' and a 'assignment operator' in C?

630






Tell me what is null pointer in c?

602


What is the best style for code layout in c?

624


what type of questions arrive in interview over c programming?

1545


What is bubble sort technique in c?

579


What is time complexity c?

558


Can you please explain the scope of static variables?

596


difference between object file and executable file

6086


What do you mean by dynamic memory allocation in c?

638


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2193


Why are all header files not declared in every c program?

592