|
- #pragma once
- #include <iostream>
- using namespace std;
- #include <string>
- class student
- {
- public:
- char name[50];
- char* p = name;
- int num;
- char sex;
- int age;
- student(char* pname, char t_sex, int t_num, int t_age)
- {
- //strcpy_s(name, pname);
- strcpy_s(p, pname);
- num = t_num;
- sex = t_sex;
- age = t_age;
- }
- };
复制代码
编译器报错:>e:\visual studio 2013\hello world\hello world\student.h(16): error C2660: “strcpy_s”: 函数不接受 2 个参数
但是我用被注释的那行代码代替就可以编译通过,
老师视频里面这样用为什么可以通过呢?是我编译器的问题吗? |
上一篇: 36课的小作业,按照答案做了还是崩溃,求解答下一篇: 关于运算符重载,报错找不出来,要疯了!!
|