M*********n 发帖数: 4839 | |
k**********g 发帖数: 989 | 2
What is the problem? we can guide you with step-by-step screenshots.
In Visual Studio, a Solution contains one or more Projects. A Project is
specific to a programming language and application type, such as Win32
Console Application. The output of this project is an executable (EXE).
If you just need a helloworld, try http://ideone.com/
【在 M*********n 的大作中提到】 : 搞了半天也出不来。
|
x****u 发帖数: 44466 | 3 Win32 console application
【在 M*********n 的大作中提到】 : 搞了半天也出不来。
|
g****t 发帖数: 31659 | 4 至于么...
【在 M*********n 的大作中提到】 : 搞了半天也出不来。
|
k**********g 发帖数: 989 | 5 Two more tips.
(1) Precompiled header. "stdafx.h"
Basically, this is the place where you put all standard library include
directives that will be needed by your code.
Examples:
// OS includes
#include
// C includes
#include
// C++ STL includes
#include
#include
Try not to include any of your own header files in "stdafx.h", until you are
familiar with the Visual C++ build process.
Never modify "stdafx.cpp". It is required to be an empty file containing
just the #include "stdafx.h" and nothing else.
Visual C++ requires the use of precompiled header. Not using precompiled
header in a Visual C++ project is considered an advanced configuration, so
this choice is not recommended for learners.
If you need to compile C source files into a Visual C++ project: you can
either add the #include "stdafx.h" to the C source file, or you can change
the per-source-file configuration.
(2) integer sizes, and using wchar_t strings with STL.
On Visual C++:
char is 8-bit.
wchar_t is 16-bit.
int is 32-bit.
long is 32-bit. (This is true for both 32-bit and 64-bit applications.)
size_t is 32-bit on 32-bit applications, and 64-bit on 64-bit applications.
sizeof(void*) is 4 on 32-bit applications, 8 on 64-bit applications.
For strings, use std::wstring, std::wcin, std::wcout, std::wcerr, std::
wstringstream, std::wifstream, std::wofstream, ...
Most Windows API functions have "narrow string vs. wide string" versions. |
c*********e 发帖数: 16335 | 6 win32 app,一个class里面有个main就出来了啊。
【在 M*********n 的大作中提到】 : 搞了半天也出不来。
|
s********i 发帖数: 145 | 7 Must be kidding me, right? VS 这么傻瓜... 你什么版本? |
d****i 发帖数: 4809 | 8 你这个是C#吧?C++里面哪有main在类里面的?
【在 c*********e 的大作中提到】 : win32 app,一个class里面有个main就出来了啊。
|
c*********e 发帖数: 16335 | 9 啥年月了,好多c++码工都转c#好多年了,你还在用c++ ?
【在 d****i 的大作中提到】 : 你这个是C#吧?C++里面哪有main在类里面的?
|
d****i 发帖数: 4809 | 10 啥年月了,好多c#码工都转java了,你还在用c#?
【在 c*********e 的大作中提到】 : 啥年月了,好多c++码工都转c#好多年了,你还在用c++ ?
|
n******t 发帖数: 4406 | 11 成天学什么singleton 这种design pattern学多了,就这样。
【在 g****t 的大作中提到】 : 至于么...
|