C++ 中 输出 隐藏怎么解决

来源:百度知道 编辑:UC知道 时间:2024/09/18 06:29:42
cout<<"sadf";
不用endl;
getch();
还用什么能刷新
例如#include<iostream.h>
#include<stdio.h>
#include <conio.h>
#include<stdlib.h>

void main()
{
char num[10];
cout<<"ewrt"<<endl;
char t;
int i=0;

do
{
t=getch();
if(t=='8')
{
cout<<"\t \t";
}
else
{
cout<<"*";
num[i]=t;
i++;
}

system("pause");

}
while(t!='e');
system("pause");

}
"*"为什么输出不了

除了endl 还可以用flush和ends刷新缓冲区 flush是直接刷新 ends是加入NULL后刷新 endl是\n后刷新

头文件定义错误 stdio.h是c语言库的 把这个删掉
你要用cout 要使用iostream
还有c++的头文件引用要这样写
#include<iostream>
using namespace std;
因为这个iostream.hc++已经不再维护了 说不定什么时候就不用了
要写成新的 养成习惯最重要

什么意思?
不懂你的描述?