新手求教
#include<iostream.h>#include<string.h>
class Cmenu
{
public:
char Name[20];
char Food[100];
char Process[200];
char setpoint(char *x)
{strcpy(point,x);}
char getpoint()
{cout<<point;}
private:
char point[200];
};
void main()
{
Cmenu Yu;
strcpy(Yu.Name,"YuxiangShreddedPork");
strcpy(Yu.Food,"pork agaric carrot some batching");
strcpy(Yu.Process,"firstly,you have to make the pork quick-fired.then putting batching into pot.besides,it is time to put agaric and carrot.finally,waitting for minutes to a mature dish");
strcpy(Yu.setpoint,"the time of this dish should be controlled in fifteen-minutes.what is more important is thicken soup which usually mixes light soy sauce,amylum,albumen and water.");
cout<<"Name:"<<Yu.Name<<"\n";
cout<<"Food:"<<Yu.Food<<"\n";
cout<<"Process:"<<Yu.Process<<"\n";
cout<<"point:"<<Yu.getpoint();
}
以下是错误
:\Users\Lenovo\Desktop\zmx.cpp(22) : error C2664: 'strcpy' : cannot convert parameter 1 from 'char (char *)' to 'char *'
There is no context in which this conversion is possible
执行 cl.exe 时出错.
zmx.obj - 1 error(s), 0 warning(s)