struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator??

Answer Posted / kk

12 is answer
int a takes 4 bytes
char b takes 4 bytes due to data padding
int *p any pointer takes 4 bytes
so totally 12 bytes........

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

2068


The file stdio.h, what does it contain?

886


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1026


Can we declare a function inside a function in c?

808


Do you have any idea about the use of "auto" keyword?

863


write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

1754


Can we increase size of array in c?

713


Describe the header file and its usage in c programming?

829


Differentiate between a structure and a union.

1014


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2475


When can you use a pointer with a function?

748


What does the format %10.2 mean when included in a printf statement?

1359


Under what circumstances does a name clash occur?

933


How many types of functions are there in c?

797


What is variable initialization and why is it important?

837