i have learn to wite out a few simple program on paper. However, after installing microsoft visual C++, i found out that i do not know how to use it to create C++ application. I click file-->new, and and the Visual C++ software prompt me to create a workspace or some window application or window console apllication. There are a lot of files in it that i can create. What should i choose??

Dani AI

Generated

A short, practical primer to follow the thread: a Visual C++ solution/workspace is just a container for one or more projects; a project holds source files plus compiler and linker settings. For learning plain C++ a console-application project is the simplest choice because it expects the familiar main() entry point. Choosing a Windows (GUI) project creates a different entry point (WinMain) and commonly produces linker errors when main() is supplied — so ’s advice to start with a console app is appropriate.

Two common stumbling blocks deserve explicit mention. First, precompiled headers (the historical stdafx.h requirement) often cause cryptic compiler errors. Options are: include #include "stdafx.h" as the first line of each .cpp when the project expects it; turn off precompiled headers in Project → Properties → C/C++ → Precompiled Headers; or start from an empty project so no pch settings are imposed. Second, verify the project type if the linker reports missing entry points or unresolved _main/WinMain symbols.

A minimal starter program:

#include <iostream>

int main()
{
    std::cout << "Hello, world\n";
    return 0;
}

Add that as a .cpp file in the project, build the solution (Build → Build Solution or Ctrl+Shift+B), and run without debugging (Debug → Start Without Debugging or Ctrl+F5) so the console remains visible. Running the compiled .exe from a command prompt also avoids the automatic window close.

Notes: ’s illustrated tutorial and ’s suggestion to consult the manual are useful next steps. ’s point about posting a polished tutorial in the Tutorials board is reasonable if a step‑by‑step guide is prepared. Typical errors to watch for: fatal error C1083 (missing include like stdafx.h), LNK2019/unresolved externals, and entry-point/linker complaints — each points to either project settings or missing/incorrect source files.

Recommended Answers

All 4 Replies

Choose a console application. That's the easiest to start with.

And read a bit in the manual, it's enlightening :)

Here's a complete tutorial , made by me :cheesy:

1.First try to get Visual C++ Express Edition ,it's free
You can get it at http://msdn.microsoft.com/vstudio/express/visualc/

2.After install,run the program .You will get the start page
[IMG][/IMG]

Create->Project

3.Go to Win32 Tab , and name your project
[IMG][/IMG]


4.Select win32 console application
[IMG][/IMG]


5.Go to application tab
[IMG][/IMG]


6.Check the "Empty project" box
[IMG][/IMG]

7.After the project is created,it's time to make your source files
Right click the Source Files Folder, go to Add->New Item
[IMG][/IMG]

8.Go to code tab
[IMG][/IMG]

9.Here,select the C++ File(don't forget to name it )
[IMG][/IMG]

10.Click add and your done
[IMG][/IMG]


Good luck

have you posted that in the tutorials board? If not, you should to that it doesn't get lost in all the traffic on this board :) :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.