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
How would you use the functions sin(), pow(), sqrt()?
What is the copy-and-swap idiom?
Explain the concept of memory leak?
What is ifstream c++?
What is time_t c++?
How to implement is-a and has-a class relationships?
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
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.
What is c++ iterator?
What is array give example?
What c++ is used for?
What is #include sstream?
Is string an object in c++?
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 Write a program in c++ to print the numbers from n to n2 except 5 and its multiples