union
{
char ch[10];
short s;
}test;
test.s = 0xabcd;
main()
{
printf("%d",ch[10]);
}
Answer Posted / shrikant auti
The code written is incorrect......
union
{
char ch[10];
short s;
}test;
test.s = 0xabcd;
main()
{
printf("%d",ch[10]);/*%D CAN'T BE USED FOR CHARACTER
EXTRACTION*/
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Do character constants represent numerical values?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Explain the difference between strcpy() and memcpy() function?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Can we change the value of static variable in c?
Why functions are used in c?
Explain why can’t constant values be used to define an array’s initial size?
how should functions be apportioned among source files?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
What is extern keyword in c?
Why do we use namespace feature?
How do we open a binary file in Read/Write mode in C?
What is the importance of c in your views?
Are the variables argc and argv are always local to main?