注册 登录
编程论坛 C++教室

能进来帮个忙不??

lklqlk1991 发布于 2010-02-18 18:36, 1220 次点击
// Note:Your choice is C++ IDE
#include <iostream>
using namespace std;
class stdunt
{
private:
string name;
int age;
char sex;
stdunt*next;
public:
void print(void);
stdunt(string a,int b,char c);
~stdunt();
};
stdunt::stdunt(string a,int b,char c)
{
name=a;
age=b;
sex=c;
}
void stdunt::print(void)
{
cout<name<<age<<sex<<endl;所有错误都指向这里!!
}
int main()
{
stdunt lk("kkkk",10,'b');
    return 0;
}

我是想写一学生信息的程序,才搞就出麻烦了。学艺不精啊!

[ 本帖最后由 lklqlk1991 于 2010-2-18 18:37 编辑 ]
11 回复
#2
worldyl2010-02-18 20:10
回复 楼主 lklqlk1991
cout<  是不是 cout<<
#3
pangding2010-02-18 21:16
呵,笔误级的错误,知道错误出在这行,干嘛不再看一眼这行?错误很明显嘛~~
#4
lklqlk19912010-02-20 08:40
我汗。。。。。。
#5
lklqlk19912010-02-20 08:45
我加了一下。还是错了。错误只一条。cout<<name<<age<<sex<<endl;
#6
pangding2010-02-20 10:26
新是错误是什么呀?
#7
lklqlk19912010-02-20 10:47
no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
#8
lklqlk19912010-02-20 13:36
我知道了。用string类型没#include<string>。才有一大堆的错误。唉。。。。。谢谢大家了
#9
pangding2010-02-20 18:28
呵呵~~
#10
luxiaocheng2010-02-20 22:38
楼主用的什么软件,我怎么看不大懂啊!
#11
feixiang11062010-03-02 14:11
汗,伟大的错误.
#12
guer1682010-04-01 10:56
楼主用的是C/C++2010的软件!学习版的!
1