How much is size of struct having 1 char & 1 integer?

Answer Posted / chinmay

#include<stdio.h>
#include<conio.h>

void main()
{
struct idk
{
char ch;
int i;
}abc;

printf("size of structure is: %d",sizeof(abc));
getch();

}

O/P is 3

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D

3064


which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?

722


Why pointer is used in c++?

617


How can you say that a template is better than a base class?

587


How do you generate a random number in c++?

606






If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?

643


What is private public protected in c++?

554


What is static function? Explain with an example

560


Differentiate between the manipulator and setf( ) function?

594


Are iterators pointers?

679


Is it possible to provide special behavior for one instance of a template but not for other instances?

635


Why is the function main() special?

626


Does dev c++ support c++ 11?

555


What is the basic structure of a c++ program?

616


Who calls main function?

587