且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Visual Studio 2013错误! ! !

更新时间:2022-01-07 09:42:01

如果这是你的应用程序在运行时给你的,那不是错误:零表示成功程序终止。非零是一个错误代码。



如果没有你想做的其他事情,那么有两种可能性:

1)你没有正确编码。如果没有看到你实际编写,编译和执行的代码,我们无法帮助你解决这个问题!

2)它完全符合你的预期,但你的计算机速度太快了。如果您的代码是这样的:

If that is what your app gave you when you ran it, that's not an error: zero indicates a successful program termination. Non zero is an error code.

If it doesn't do what else you wanted, then there are 2 possibilities:
1) You didn't code it right. We can't help you fix this without seeing the code you actually wrote, compiled, and executed!
2) It did exactly what you expected, but your computer is too fast. If your code was this:
static void main()
   {
   Console.WriteLine("Hello world");
   }

然后程序可以打开控制台窗口,打印消息,退出应用程序,然后关闭控制台窗口,直到你发现它已经打开...

尝试在主方法的结束大括号之前添加此行:

Then the program could well open the console window, print the message, exit the app, and close the console window before you even noticed it was open...
Try adding this line before the closing curly bracket of the main method:

Console.ReadLine();

它将停止直到你退出前按ENTER键。

And it will stop until you press ENTER before it exits.


事实上你的代码退出,你没有机会看到它的输出。

为了看到输出您可以暂停执行,例如让您的程序等待用户输入,例如

As matter of fact your code exits and you have no chance to see its output.
In order to see the output you might pause the execution, for instance making your program wait for user input, e.g.
#include <iostream>
using namespace std;

int main()
{
	cout << "\n Hello world!" << endl;
    cin.get();
	return 0;
}


第一:代码是用C ++编写的,写的是正确的。



First: The code was written in C++ and is written right.

#include <iostream>
using namespace std;

int main()
{
	cout << "\n Hello world!" << endl;
	return 0;
}





第二,就像我在编译代码时说的那样:

程序退出时代码为0(0x0)。

且控制台窗口不打印消息。



And second, like I said when I compile the code I get:
The program has exited with code 0 (0x0).,
and the console windows doesn't print the message.