lỗi 'strcpy' was not declared in this scope

e bị lỗi trên vs đoạn code sau:

#include<iostream>
using namespace std;
class KhoiTao
{
	private:
		char *maLop,*maSV,*hoTen,*ngaySinh;
		float *diemTB;
	public:
		KhoiTao()
		{
			maLop = new char[10];
			maSV = new char[10];
			hoTen = new char[100];
			ngaySinh = new char[10];
		}
		void setmaLop(char *);
		char getmaLop();
		void setmaSV(char);
		char getmaSV();
		void sethoTen(char);
		char gethoTen();
		void setngaySinh(char);
		char getngaySinh();
		void setdiemTB(float);
		float getdiemTB();
		void setSoSV(int);
};



#include <iostream>
#include "KhoiTao.h"
using namespace std;
void KhoiTao::setmaLop(char *ml)
{
	strcpy(maLop,ml);
}

ai giúp e vs :frowning:

Bạn đã include string header file chưa?

  #include <string>
1 Like

Đã thêm nhưng vẫn k đc ạ

#include < cstring>
Hoặc #include < string.h>

1 Like

? ý bro là sao ???

ok đc r ạ tks các bro :smile:

This topic was automatically closed after 3 hours. New replies are no longer allowed.

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?