C++ compiler and OOP

Hi,
I have two questions:
1) how does a compiler handle programs, I mean suppose I have a program which makes a GUI, after I have executed the program and the GUI displayed, does the compiler keep on going repeatedly through the entire program even when nothing is done on the GUI?

2)with regard to OOP, is it recommended to make a program which include both classes and structures. This is because I think there is no reason to include both of them in one program since they are more or less the same.

cheers.
1) The compiler just translates C++ code to machine code, it plays no role in the final executable.
The program will do what you told it to do - no more, no less.
Usually programs with a GUI wait until an event occurs which is then processed appropriately.

2) There is no difference except default attributes (public for struct, private for class). Generally it makes sense to use struct for classes whose sole purpose is to store data and class for pretty much everything else.
does the compiler keep on going repeatedly


1) That is an interpreter. Make sure it isn't prior to GUI compilement.
2) They may not unless key objects are defined such as storage of data.
Topic archived. No new replies allowed.