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

Answer Posted / uttam kumhar

1 char always hold 1 byte in c in any 32-bit or 64-bit system
but in case of int it vary on the system.if there is 32-bit system the int hold 4-byte memory ...and if 64-bit system int hold 2-byte memory....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which header file allows file i/o with streams a) fileio.h b) iostream.h c) fstream.h

885


What are the c++ access specifiers?

1096


What does ios :: app do in c++?

802


how can i access a direct (absolute, not the offset) memory address? here is what i tried: wrote a program that ask's for an address from the user, creates a FAR pointer to that adress and shows it. then the user can increment/decrement the value in that address by pressing p(inc+) and m(dec-). NOW, i compiled that program and opened it twice (in 2 different windows) and gave twice the same address to it. now look what happen - if i change the value in one "window" of the program, it DOES NOT change in the other! even if they point to the same address in the memory! here is the code snippet: //------------------------------------------------------ #include //INCLUDE EVERY KNOWN HEADER FILE #include //FOR ANY CASE... #include #include #include main() { int far *ptr; //FAR POINTER!!! long address; char key=0; //A KEY FROM THE KEYBOARD int temp=0; clrscr(); cout<<"Enter Address:"; cin>>hex>>address; //GETS THE ADDRESS clrscr(); (long)ptr=address; temp=*ptr; //PUTS THE ADDRESS IN THE PTR cout<<"["<

2112


Can a constructor return a value?

918


what is oops and list its features in c++?

778


What is the average salary of a c++ programmer?

795


What is a try block?

863


What is the full form nasa?

783


Can constructor be static in c++?

871


Is c++ a low level language?

720


what is Member Functions in Classes?

852


Is rust better than c++?

867


What does the ios::ate argument do?

930


What is the latest c++ standard?

899