Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
Answer Posted / vikraman85
Size fo strucure wil be the total bytes of the datatypes
inside it..
so,4+4=8;
For unions the size wi be the size of the datatype whose
memory is high,.
so,its 4,.
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is the use of header files?
Write a program of prime number using recursion.
Is main is user defined function?
what is event driven software and what is procedural driven software?
What is malloc and calloc?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
Why isn't it being handled properly?
What is the difference between typedef struct and struct?
Explain what is the benefit of using const for declaring constants?
How do you determine whether to use a stream function or a low-level function?
What is the significance of an algorithm to C programming?
What are the types of assignment statements?
Why is sprintf unsafe?
What are # preprocessor operator in c?
How can I prevent another program from modifying part of a file that I am modifying?