你好你好 [英] OUTPUT HELLO

查看:81
本文介绍了你好你好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。


下面由C ++编写的着名Hello代码。通过它的母亲计划

Visual studio 2005


当我复制到这个程序的所有文件并点击.EXE文件时

来自母节目,输出立即消失。


任何人都可以添加一行(可能与Keypress相关,因此输出可以

逗留不消失?


感谢大家。


-------------- ---------------------------------------


#include< iostream>


使用std :: cout;


使用std :: endl;


int main()


{


cout<<" HELLO WORLD";


cout<< endl;


返回0;


}

解决方案

6月19日上午10点50分,你好< f ... @ alphalink.com.auwrote:


大家好。


有名的以下是C ++编写的Hello代码。通过它的母亲计划

Visual studio 2005


当我复制到这个程序的所有文件并点击.EXE文件时

来自母节目,输出立即消失。


任何人都可以添加一行(可能与Keypress相关,因此输出可以

逗留不消失?


感谢大家。


-------------- ---------------------------------------


#include< iostream>


使用std :: cout;


使用std :: endl;


int main()


{


cout<<" HELLO WORLD";


cout<< endl;


返回0;


}



似乎这不是一个真正的C ++语言问题。

当您从资源管理器中双击时,您正在创建一个控制台模式

应用程序,当您的程序返回。当你xecuting
来自Visual C ++ IDE的
程序,由vcspawn.exe生成的应用程序

将等待用户输入退出。我不知道为什么他们直接从Visual Studio执行程序时需要它b / b $

你必须打电话


"你好" < fa *** @ alphalink.com.auwrote in message

news:46 ******** @ news.chariot.net.au ...


大家好。


下面用C ++编写的着名Hello代码。通过它的母亲计划

Visual studio 2005


当我复制到这个程序的所有文件并点击.EXE文件时

来自母节目,输出立即消失。


任何人都可以添加一行(可能与Keypress相关,以便输出

可以

逗留而不会消失吗?


感谢大家。


------ -----------------------------------------------


#include< iostream>



#include< string>


使用std :: cout;


使用std :: endl;


int main()


{


cout<<"" HELLO WORLD";


cout<< endl;



std :: string wait;

std :: getline(std :: cin,wiat);


返回0;


}


还有另一种更简单的方法,你不需要你创建一个

std :: string,但我不记得了。 cin.somethingorother();


" Hello"写道:


下面由C ++编写的着名Hello代码。通过它的母亲计划

Visual studio 2005


当我复制到这个程序的所有文件并点击.EXE文件时

来自母节目,输出立即消失。


任何人都可以添加一行(可能与Keypress相关,以便输出

可以

逗留而不会消失吗?


感谢大家。


------ -----------------------------------------------


#include< iostream>


使用std :: cout;


使用std :: endl;


int main()


{


cout<<<" HELLO WORLD" ;;


cout<< endl;



添加以下行:


cin.get();


返回0;


}



Hi every one.

The famous Hello code below written by C++. through its mother program
"Visual studio 2005"

When I make copy to all files of this program and click on .EXE file away
from the mother program, the output disappears immediately.

Can any person add a line (may related to" Keypress", so that the output can
stay without disappearing?

Thank to all.

-----------------------------------------------------

#include<iostream>

using std::cout;

using std::endl;

int main()

{

cout<< " HELLO WORLD ";

cout<<endl;

return 0;

}

解决方案

On Jun 19, 10:50 am, "Hello" <f...@alphalink.com.auwrote:

Hi every one.

The famous Hello code below written by C++. through its mother program
"Visual studio 2005"

When I make copy to all files of this program and click on .EXE file away
from the mother program, the output disappears immediately.

Can any person add a line (may related to" Keypress", so that the output can
stay without disappearing?

Thank to all.

-----------------------------------------------------

#include<iostream>

using std::cout;

using std::endl;

int main()

{

cout<< " HELLO WORLD ";

cout<<endl;

return 0;

}

Seems this is not really a C++ languge question.
When you double click from explorer, you are creating a console mode
application which end when your program returns. While you executing
program from Visual C++ IDE, the application spawned by vcspawn.exe
which will wait for a user input to exit. i dont know why they
required it while execute program directly from Visual Studio.
You have to call


"Hello" <fa***@alphalink.com.auwrote in message
news:46********@news.chariot.net.au...

Hi every one.

The famous Hello code below written by C++. through its mother program
"Visual studio 2005"

When I make copy to all files of this program and click on .EXE file away
from the mother program, the output disappears immediately.

Can any person add a line (may related to" Keypress", so that the output
can
stay without disappearing?

Thank to all.

-----------------------------------------------------

#include<iostream>

#include <string>

using std::cout;

using std::endl;

int main()

{

cout<< " HELLO WORLD ";

cout<<endl;

std::string wait;
std::getline( std::cin, wiat );

return 0;

}

There is another easier way that doesn''t require you to create a
std::string, but I can''t remember it. cin.somethingorother();


"Hello" writes:

The famous Hello code below written by C++. through its mother program
"Visual studio 2005"

When I make copy to all files of this program and click on .EXE file away
from the mother program, the output disappears immediately.

Can any person add a line (may related to" Keypress", so that the output
can
stay without disappearing?

Thank to all.

-----------------------------------------------------

#include<iostream>

using std::cout;

using std::endl;

int main()

{

cout<< " HELLO WORLD ";

cout<<endl;

add this line:

cin.get();

return 0;

}



这篇关于你好你好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆