c语言头文件错误,大佬们看一下
#include"stdafx.h"
#include"iostream.h"
#include<iomanip.h>
#include"string.h"
intmain()
{
char Username[10];
char password[10];
cout<<"请输入用户名: ";
cin>>username;
cout<<"请输入密码: ";
cin>>password;
cout<<"用户名: "<<Username<<setm(13-strlen(Username))<<"|| ";
cout<<"密码: "<<Password<<setm(13-strlen(password))<<"|| ";
return 0;
}
几个问题
首先
#include"stdafx.h"是vc++专有的头文件,你若用其它编译器,这个不能有的
其次
#include"iostream.h"
#include<iomanip.h>
是上世纪就已淘汰的vc++6.0才有的头文件,不符合C++标准,目前的编译器不支持的
你要用
#include <iostream>
#include<iomanip>
using namespace std;
代替它
另外你程序中username,password的定义有及使用中,大小写不一致
还有标准的C++没有setm函数的
所以可以说,你程序完全不正确
建议一:要使用新的教材或参考
二:注意每个细节(如大小写)
下一篇:二叉树以二叉链表存储,
上一篇:c语言题目求解为什么
热门标签: