#include<iostream.h>
#include<string.h>
class book
{private:
char bookname[40];
char writename[10],writesex;
char booknum[10];
public:
book(char x[40],char y[10],char z, char w[10])
{ strcpy(bookname,x);
strcpy(writename,y);
writesex=z;
strcpy(booknum,w);
cout<<bookname[40]<<writename[10]<<writesex<<booknum[10]<<endl;
}
};
void main()
{
book a("dkfjdk","Ling",'M',"BA377457");
}
为什么它的运行结果是MM,而不是dkfjdk Ling M BA377457呢?