My apologies. I subscribe to the school of thought (well, if there is no such school then I'm the founder
) that says introductory explanations should be as complete as possible without overwhelming the student. So I shall now provide a complete yet simple answer:
MSVC deals with the notion of
Workspaces. A workspace hosts one or more
Projects, which define a target platform, a type, and files included in the project. Within the workspace, browse information is made available that allows you to see the members of structures and parameters of functions when you declare/access them - IntelliSense. Unfortunately, IntelliSense is buggy as hell and craps out randomly, and also only browses files that are part of the project (added to the project), as opposed to simply being included.
The two most common project types in game programming are
Win32 Console Application and
Win32 Application. The first defines a project with entry point main and automatically allocates a console for the process, while the second has the entry point WinMain and doesn't pre-allocate any windows.
That's the only significant difference between them, though others will misinform you otherwise.
Include filesC++ has been standardized (November 97, though it's called C++98), and the new standard defines all entities that are a part of the Standard C++ Library. This is basically the Standard Template Library and IOStreams. All entities in the Standard C++ Library are part of the std namespace, and therefore must be imported to be used. Personally, I avoid namespace pollution like the plague, so you will often see a bunch of using statements in my code as I import individual entities.
Standard C++ Library header files have no .h extension.
#include <iostream>#include <string>using std::cin;using std::cout;using std::endl;using std::getline;using std::string;int main(){ string str; cout << "Enter a single-word string (may contain numbers): "; cin >> str; cout << "You entered \"" << str << "\".\nNow enter any arbitrary string, including whitespace and punctuation: "<< endl; getline(cin, str); cout << "You entered the following string:\n" << str << endl; return 0;}
[Edit: Inserted the word "significant" somewhere in there...]
[
GDNet Start Here |
GDNet Search Tool |
GDNet FAQ |
MS RTFM [MSDN] |
SGI STL Docs |
Google! ]
Thanks to Kylotan for the idea!
[edited by - Oluseyi on March 18, 2002 11:48:41 AM]