struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator??
Answer Posted / gagandeep
The total size would be 5.
Since 'int a' takes 2;
'char b' takes 1; and
'int *p' takes 2 (Note: Any pointer variable would take 2 bytes)
There is no additional size of 'struct' data structure.
Hence 5 is the value.
| Is This Answer Correct ? | 12 Yes | 10 No |
Post New Answer View All Answers
What does the characters “r” and “w” mean when writing programs that will make use of files?
What is the use of clrscr?
What is optimization in c?
How can I automatically locate a programs configuration files in the same directory as the executable?
How can I recover the file name given an open stream or file descriptor?
write an interactive C program that will encode or decode a line of text.To encode a line of text,proceed as follows. 1.convert each character,including blank spaces,to its ASCII equivalent. 2.Generate a positive random integer.add this integer to the ASCII equivalent of each character.The same random integer will be used for the entire line of text. 3.Suppose that N1 represents the lowest permissible value in the ASCII code,and N2 represents the highest permissible value.If the number obtained in step 2 above(i.e.,the original ASCII equivalent plus the random integer)exceeds N2,then subtract the largest possible multiple of N2 from this number,and add the remainder to N1.Hence the encoded number will always fall between N1 and N2,and will therefore always represent some ASCII character. 4.Dislay the characters that correspond to the encoded ASCII values. The procedure is reversed when decoding a line of text.Be certain,however,that the same random number is used in decodingas was used in encoding.
What is 2c dna?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Can a local variable be volatile in c?
why we wont use '&' sing in aceesing the string using scanf
Write a Program to accept different goods with the number, price and date of purchase and display them
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
What is adt in c programming?
what is the format specifier for printing a pointer value?
What is a example of a variable?