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

求大神帮忙救救这个程序啊。。。。。。。在线,坐等。

qq710994227 发布于 2013-12-17 17:10, 366 次点击
只有本站会员才能查看附件,请 登录
6 回复
#2
qq7109942272013-12-17 17:10
   有木有人教教我啊。主要是我做到这里我就不会改了。。。呜呜。。。
#3
qq7109942272013-12-17 17:23
  没有人么?
#4
peach54602013-12-17 17:39
耐心一点,慢慢等...
#5
左手拉一只猫2013-12-17 21:14
我表示帮别人找BUG是件痛苦的事情。。。
#6
左手拉一只猫2013-12-17 21:38
程序错误多多额。。。(1)默认的构造函数没写(2)全局变量放在头文件里面了(成了一个灾难)(3)运行的时候指针跑飞了(还没细看)。。。下次有空再改好了。。。
#7
pangshch2013-12-17 22:27
main()函数里面:
 Banji stuifo(100);
return 0;
banji.cpp里面:#include "banji.h"
#include <iostream>
#include <string>

#include <fstream>
using namespace std;

中间
 }
        break;
    }
        case 3:

            break;
        
    }

student .cpp
#include "student.h"
#include <iostream>
#include <string>
using namespace std;

void Student::SetStudentName(string str)
{
    if(str[0]=='\0')
    {
        string str1;
        str1 = new char[20];  // 析构函数里面要删除内存。
        cout<<"输入姓名:";
        cin >> str1;
        this->name=str1;
    }
    else
        this->name=str;
}
1