![]() |
Competent C++ programmers! Questions!
For any of you who are competent with C++, I have a few questions that I need answered, and hopefully you can provide me with them.
These are some of the questions that I can't find on the Internet, and because the C++ group I created seems to be pretty quiet as well, the only place I could really ask these questions was here. |
found this link about destructors because it sounded intresting
http://publib.boulder.ibm.com/infoce...%2Fcplr380.htm you would use a destructor to clean up, the link sort of explains it |
Test it out and find out :P
|
Quote:
ifdef and endif are preprocessor commands. If I were to write something like #ifdef WINDOWS_VERSION //Insert platform-specific Windows code here. #endif #ifdef LINUX_VERSION //Insert platform-specific Linux code here. #endif Then I can change the codebase at compile time by defining the flag WINDOWS_VERSION or LINUX_VERSION. In this example, I'd use this so I wouldn't have to have two different project files for a Linux and Windows version, because most of the code is platform-independent anyway. "this" refers to the instance of the class you're working with. If I define a member function for a "car" class that has "wheels" as a variable, I can reference it by using either "wheels" or "this->wheels". If there is another variable in scope with the name "wheels", then "this->wheels" will always refer to the variable associated with the object by which the member function belongs to. |
| All times are GMT. The time now is 03:24 AM. |
Powered by vBulletin/Copyright ©2000 - 2026, vBulletin Solutions Inc.