At *compile time* the compiler will look at your class definition and say "that requires <n> bytes to store one object".
I have some uncertainty here. What you say makes sense, and I really believe this is what happens. However, what about objects such as strings? The compiler cannot know a priori what data will be stored in a string. This suggest to me the data of a string is not 'part' of the object. It is data pointed to by a member of the object.
Spot on. The object will keep track of the memory it allocates, and will tidy up after itself when it's destroyed.
pointer register when the function completes. Typically we wouldn't have hundreds of images of a function on the stack. Such a situation would only occur in some kind of recursive invocation where a function calls itself and therefore causes another instance of itself to be loaded on the stack.
A method call isn't a particularly clever thing. There's a bit of code somewhere in the program text segment which gets called just like any other function. The only difference between it and a bog standard C function is that the compiler generates it's code such that it takes one extra parameter on top of the ones the programmer writes: a pointer to the object it has to work with. This is the 'this' pointer which you can use (implicitly or explicitly) inside the code. Put another way, the compiler ensures that when it sees something like: ObjClass* myObj; myObj->aMethod( x, y, z ); it actually generates code for the call like: ObjClass::aMethod( myObj, x, y, z ); and the method definition is like: ObjClass::aMethod( ObjClass* this, int x, int y, int z ) { ... }
[I'm gonna back off form these implementation details for now.]
Oh. OK. Ignore the bit above!
never help me write code. I suspect, however, many of the people who simply pick up QT and start using the designer will reach a point where everything falls appart, and they don't know what to do to fix it.
Certainly no harm in understanding what's going on! Designer, though, isn't an IDE. It's just a GUI code generator which never takes any real control out of your hands. I guess there are environments where your point is valid though - I don't use them. -- "...our desktop is falling behind stability-wise and feature wise to KDE ...when I went to Mexico in December to the facility where we launched gnome, they had all switched to KDE3." - Miguel de Icaza, March 2003