即使我更改代码,cmd也会显示相同的输出 [英] cmd showing the same output even if i change code

查看:87
本文介绍了即使我更改代码,cmd也会显示相同的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我的问题是,例如当我进行编译时

cout<< ''helloworld;<< endl;

当我在Windows命令中进行编译时,它带给我结果世界,然后,如果我更改并在编译器中放入其他代码,例如

我输入了不同的代码

hello everybody ,


well my question was , when i compile for example

cout << ''helloworld "; << endl;

when i compile in windows command , it brings me out the result hello world, then if i change and put different code in my compiler for example

i type a different code

<pre>

#include< string>


使用名称空间std;
#include< string>


使用名称空间std;


int main()
{
static const int WIDTH = 18;
static const int HEIGHT = 8;
字符串边框(WIDTH-2,''#'');
字符串空格(WIDTH-2,'''');

cout<<"----------------------";
cout<< ``#''<<边框<< ``#''<< endl;

//这是循环的修复方法
for(unsigned int i = 1; i< HEIGHT; ++ i)
{
cout<< ``#''<<空格<< ``#''<< endl;
}
cout<< ``#''<<边框<< ``#''<< endl;

//就我个人而言,我更喜欢使用cin.get()而不是system("pause")
cin.get();

返回0;
}


而不是将结果发送给我在屏幕上显示的代码,它带给了我以前的代码问候世界,即使我更改并放置了另一个代码..

好吧,我尝试过重建和重新编译,但是当屏幕出来时什么都没有改变..它只带来了我早些时候开始编译的代码...

有人可以知道如何清理或重置以便获得更新的结果吗?

我想我使它比上一条消息更清晰了.

#include <string>


using namespace std;
#include <string>


using namespace std;


int main()
{
static const int WIDTH=18;
static const int HEIGHT=8;
string border(WIDTH-2,''#'');
string spaces(WIDTH-2,'' '');

cout <<"----------------------";
cout << ''#'' << border << ''#'' << endl;

// And here is the fix for the loop
for(unsigned int i=1; i < HEIGHT; ++i)
{
cout << ''#'' << spaces << ''#'' << endl;
}
cout << ''#'' << border << ''#'' << endl;

// Personally I prefer using cin.get() instead of system("pause")
cin.get();

return 0;
}


instead of sending me the result on that code on the screen , it brings me the previous code hello world , even if i change and put another code ..

well i have tried to rebuild and recompile but nothing change when the screen comes out .. it only brings the code that i started compiling earlier ...

can anybody know how to clean or reset so that i get the updated result ?

i think i made it a little bit clearer than the previous message

推荐答案

我怀疑您正在构建到其他输出目录中,但仍在执行旧版本.尝试对程序进行完全重建,并检查它是否确实在构建新的可执行文件.
I suspect you are building into a different output directory but still executing the old version. Try doing a complete rebuild of your program, and check that it does in fact build a new executable.


恐怕您的问题并没有太大意义.也许您可以尝试解释更多您想做的事情以及问题所在.
I am afraid that your question does not make much sense. Perhaps you could try to explain more of what you are trying to do, and what the problem is.


您还记得喂仓鼠吗? :rolleyes:
Did you remember to feed the hamsters? :rolleyes:


这篇关于即使我更改代码,cmd也会显示相同的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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