main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
1 2
Explanation:
The sizeof() operator gives the number of bytes
taken by its operand. P is a character pointer, which needs
one byte for storing its value (a character). Hence
sizeof(*p) gives a value of 1. Since it needs two bytes to
store the address of the character pointer sizeof(p) gives 2.
| Is This Answer Correct ? | 16 Yes | 7 No |
Answer / jha334201553
sizeof(*p) = sizeof(char) = 1
sizeof(p) = sizeof(void *)
I don't know the value of sizeof(p) .In deferent system the
value is deferent.In DOD, it's 2. int 32bits winNT, it's 4.
in 64bits WinNT, It's 8
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / dilberphant
The results are indeterminate. The program code is in error.
1) The variadic function printf() requires an in-scope
prototype. No prototype for printf() has been provided.
2) main() is (by definition) a function that returns an
integer value. It is unclear which version of the C language
this program is intended to conform to, and for most
versions of the language, main() is required to include a
return <value>;
for some integer <value>
3) In a hosted environment, main() accepts either two
arguments (an int, and a char *[]) or none. Thus, either
main(int argc, char *argv[])
or
main(void)
are acceptable
4) The size of a pointer is dependant on operating platform
and C compiler implementation. The C language does not
define a "correct" value for sizeof (char *), and thus /any/
value for sizeof (char *) is acceptable (with the above
caveats about platform and compiler). The value is
unpredictable at a theoretical level.
| Is This Answer Correct ? | 2 Yes | 1 No |
How to swap two variables, without using third variable ?
104 Answers AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,
How will u find whether a linked list has a loop or not?
Write a single line c expression to delete a,b,c from aabbcc
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,
plz send me all data structure related programs
How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...
6 Answers Microsoft, MSD, Oracle,
Display the time of the system and display the right time of the other country
plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............
main() { int i=5,j=6,z; printf("%d",i+++j); }
Cluster head selection in Wireless Sensor Network using C programming language.
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?