whats the size of class EXP on 32 bit processor?
class EXP
{
char c1;
char c2;
int i1;
int i2;
char *ptr;
static int mem;
};

Answer Posted / sandeep mannarakkal

Static is independent of object but associated with class, i.e size of the object is independent of the static.
so here answer is 16 byes.(with the assumption of structure padding is available.)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you use the functions sin(), pow(), sqrt()?

744


What is the copy-and-swap idiom?

614


Explain the concept of memory leak?

633


What is ifstream c++?

570


What is time_t c++?

615






How to implement is-a and has-a class relationships?

591


How do you find out if a linked-list has an end? (I.e. The list is not a cycle)

607


write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.

2256


What is c++ iterator?

651


What is array give example?

604


What c++ is used for?

592


What is #include sstream?

634


Is string an object in c++?

663


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<<"["<

1821


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

2045