//源程序
#include <iostream>
#include <string>
//#include <string.h>
using namespace std;
class Teacher //声明教师类
{
public: //公用部分
Teacher(string nam,int a,string t) //构造函数的初始化
{
na

展开全部
收起
3回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • Dara永远三岁

    14人对此回答表示赞同

    error C2664: 'strcpy' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'char *'
    No user-defined-conversion operator availa
    展开
    14
    0回复
    发布于 5年前

    评论(0)

    收起评论

  • DarvinAaron

    9人对此回答表示赞同

    Student(string nam,char s,float sco)   //学生类的初始化
    {
    namel = name;
    sex=s;
    score=sco;
    }

    Student的构造函数应该也用string nam,而不是char nam[]

    展开
    9
    0回复
    发布于 5年前

    评论(0)

    收起评论

  • Thomas

    8人对此回答表示赞同

    <string.h>只用于对字符数组的复制,不用于对string类型的复制
    展开
    8
    0回复
    发布于 5年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部