c++ 求简单成为唱吧大神 简单点

void *memccpy (void *dest, const void *src, int c, size_t n);
从src所指向的对象复制n个字符到dest所指向的对象中。如果复制过程中遇到了字符c则停止复制,返回指针指向dest中字符c的下一个位置;否则返回NULL。
void *memcpy (void *dest, const void *src, size_t n);
从src所指向的对象复制n个字符到dest所指向的对象中。返回指针为dest的值。
void *memchr (const void *s, int c, size_t n);
在s所指向的对象的前n个字符中搜索字符c。如果搜索到,返回指针指向字符c第一次出现的位置;否则返回NULL。
int memcmp (const void *s1, const void *s2, size_t n);
比较s1所指向的对象和s2所指向的对象的前n个字符。返回值是s1与s2第一个不同的字符差值。
int memicmp (const void *s1, const void *s2, size_t n);
比较s1所指向的对象和s2所指向的对象的前n个字符,忽略大小写。返回值是s1与s2第一个不同的字符差值。
void *memmove (void *dest, const void *src, size_t n);
从src所指向的对象复制n个字符到dest所指向的对象中。返回指针为dest的值。不会发生内存重叠。
void *memset (void *s, int c, size_t n);
设置s所指向的对象的前n个字符为字符c。返回指针为s的值。
char *stpcpy (char *dest, const char *src);
复制字符串src到dest中。返回指针为dest + len(src)的值。
char *strcpy (char *dest, const char *src);
复制字符串src到dest中。返回指针为dest的值。
char *strcat (char *dest, const char *src);
将字符串src添加到dest尾部。返回指针为dest的值。
char *strchr (const char *s, int c);
在字符串s中搜索字符c。如果搜索到,返回指针指向字符c第一次出现的位置;否则返回NULL。
int strcmp (const char *s1, const char *s2);
比较字符串s1和字符串s2。返回值是s1与s2第一个不同的字符差值。
int stricmp (const char *s1, const char *s2);
比较字符串s1和字符串s2,忽略大小写。返回值是s1与s2第一个不同的字符差值。
size_t strcspn (const char *s1, const char *s2);
返回值是字符串s1的完全由不包含在字符串s2中的字符组成的初始串长度。
size_t strspn (const char *s1, const char *s2);
返回值是字符串s1的完全由包含在字符串s2中的字符组成的初始串长度。
char *strdup (const char *s);
得到一个字符串s的复制。返回指针指向复制后的字符串的首地址。
char *strerror(int errnum);
返回指针指向由errnum所关联的出错消息字符串的首地址。errnum的宏定义见errno.h。
size_t strlen (const char *s);
返回值是字符串s的长度。不包括结束符'\0'。
char *strlwr (char *s);
将字符串s全部转换成小写。返回指针为s的值。
char *strupr (char *s);
将字符串s全部转换成大写。返回指针为s的值。
char *strncat (char *dest, const char *src, size_t maxlen);
将字符串src添加到dest尾部,最多添加maxlen个字符。返回指针为dest的值。
int strncmp (const char *s1, const char *s2, size_t maxlen);
比较字符串s1和字符串s2,最多比较maxlen个字符。返回值是s1与s2第一个不同的字符差值。
char *strncpy (char *dest, const char *src, size_t maxlen);
复制字符串src到dest中,最多复制maxlen个字符。返回指针为dest的值。
int strnicmp(const char *s1, const char *s2, size_t maxlen);
比较字符串s1和字符串s2,忽略大小写,最多比较maxlen个字符。返回值是s1与s2第个不同的字符差值。
char *strnset (char *s, int ch, size_t n);
设置字符串s中的前n个字符全为字符c。返回指针为s的值。
char *strset (char *s, int ch);
设置字符串s中的字符全为字符c。返回指针为s的值。
char *strpbrk (const char *s1, const char *s2);
返回指针指向字符串s1中字符串s2的任意字符第一次出现的位置;如果未出现返回NULL。
char *strrchr (const char *s, int c);
在字符串s中搜索字符c。如果搜索到,返回指针指向字符c最后一次出现的位置;否则返回NULL。
char *strrev (char *s);
将字符串全部翻转,返回指针指向翻转后的字符串。
char *strstr (const char *s1, const char *s2);
在字符串s1中搜索字符串s2。如果搜索到,返回指针指向字符串s2第一次出现的位置;否则返回NULL。
char *strtok (char *s1, const char *s2);
用字符串s2中的字符做分隔符将字符串s1分割。返回指针指向分割后的字符串。第一次调用后需用NULLL替代s1作为第一个参数。
Views(...) Comments()c++游戏编程,写一个游戏编程,简单点_百度知道
c++游戏编程,写一个游戏编程,简单点
答题抽奖
首次认真答题后
即可获得3次抽奖机会,100%中奖。
采纳数:488
获赞数:1535
#include&iostream&#include&iomanip&using&namespace&const&int&X&=&21;&//棋盘行数const&int&Y&=&21;&//棋盘列数char&p[X][Y];&&//定义棋盘int&m=0;//定义临时点,保存输入坐标int&n=0;void&display()&&//输出棋盘{ for(int&i=0;&i&X;&i++)
cout&&setw(3)&&setfill('&')&&i; cout&& for(int&i=1;&i&Y;&i++) {
cout&&setw(3)&&setfill('&')&&i;
for(int&j=1;j&X;j++)
cout&&setw(3)&&setfill('&')&&p[i][j];
cout&& } }void&black()&&//黑方落子{ cout&&&请黑方输入落子位置:\n&
&&&请输入落子的行数:&; cin&&m; cout&&&请输入落子的列数:&; cin&&n; if(m&=0||m&=X||n&=Y||n&=0) {
cout&&&超出棋盘范围,请重新输入正确坐标!\n&;
black(); } else&if((p[m][n]==1)||p[m][n]==2) {
cout&&&该点已有棋子,请重新选取落子点!\n&;
black(); } else
p[m][n]=1;&//黑方用1来表示 system(&cls&); display();}void&red()&&//红方落子{ cout&&&请红方输入落子位置:\n&
&&&请输入落子的行数:&; cin&&m; cout&&&请输入落子的列数:&; cin&&n; if(m&=X||m&=0||n&=0||n&=Y) {
cout&&&超出棋盘范围,请重新输入正确坐标!\n&;
red(); } else&if((p[m][n]==1)||p[m][n]==2) {
cout&&&该点已有棋子,请重新选取落子点!\n&;
red(); } else
p[m][n]=2;&//红方用2来表示 system(&cls&); display();}int&evalue()&&//只需要判断落子点为中心的九点“米”字是否连续即可{ int&k&=&0,r&=&0; /*斜线判断*/ for(k=3;k&X-2;k++)&&//两条,其中的p[k][r]!='-'是排除空子的情况 {
for(r=3;r&Y-2;r++)
if(p[k][r]!='-'&&p[k-2][r-2]==p[k][r]&&p[k-1][r-1]==p[k][r]&&p[k+1][r+1]==p[k][r]&&p[k+2][r+2]==p[k][r])
else&if(p[k][r]!='-'&&p[k+2][r-2]==p[k][r]&&p[k+1][r-1]==p[k][r]&&p[k-1][r+1]==p[k][r]&&p[k-2][r+2]==p[k][r])
} } /*横线判断*/ for(k=1;k&X;k++)&&//p[k][r]!='-'是排除空子的情况
for(r=3;r&Y-2;r++)
if(p[k][r]!='-'&&p[k][r-2]==p[k][r]&&p[k][r-1]==p[k][r]&&p[k][r+1]==p[k][r]&&p[k][r+2]==p[k][r])
return&1; /*竖线判断*/ for(k=3;k&X-2;k++)&&//p[k][r]!='-'是排除空子的情况
for(r=1;r&Y;r++)
if(p[k][r]!='-'&&p[k-2][r]==p[k][r]&&p[k-1][r]==p[k][r]&&p[k+1][r]==p[k][r]&&p[k+2][r]==p[k][r])
return&1;&&&&return&0; }int&main(){ memset(p,'-',441);&&//初始化为‘-’ cout&&&欢迎使用简易双人对战五子棋游戏\n&
&&&五子棋棋谱如下:\n&; display(); while(1) {
if(evalue())
cout&&&红方赢!\n&;
if(evalue())
cout&&&黑方赢!\n&;
} return&0;}人人对战五子棋
采纳数:26
获赞数:98
2048游戏即可,写个简单的,就行
襄见恨晚love
襄见恨晚love
采纳数:174
获赞数:759
贪吃蛇,源代码网上有
你能复制下吗,什么坐标都给添上
这是一个代码的地址
ignorallbutyou
来自电脑网络类芝麻团
ignorallbutyou
采纳数:40
获赞数:201
参与团队:
这里有好多基础的代码 你如果想要的话我用mfc做过两个小游戏 我给你发过去
能留下Q吗,这个代码打不开
打开 .dsw 后缀的文件
引用忽忽上升的回答:#include&iostream&#include&iomanip&const int X = 21; //棋盘行数const int Y = 21; //棋盘列数char p[X][Y];
//定义棋盘int m=0;//定义临时点,保存输入坐标int n=0;void display()
//输出棋盘{ for(int i=0; i&X; i++)
cout&&setw(3)&&setfill(' ')&&i; cout&& for(int i=1; i&Y; i++) {
cout&&setw(3)&&setfill(' ')&&i;
for(int j=1;j&X;j++)
cout&&setw(3)&&setfill(' ')&&p[i][j];
cout&& } }void black()
//黑方落子{ cout&&&请黑方输入落子位置:\n&
&&&请输入落子的行数:&; cin&&m; cout&&&请输入落子的列数:&; cin&&n; if(m&=0||m&=X||n&=Y||n&=0) {
cout&&&超出棋盘范围,请重新输入正确坐标!\n&;
black(); } else if((p[m][n]==1)||p[m][n]==2) {
cout&&&该点已有棋子,请重新选取落子点!\n&;
black(); } else
p[m][n]=1; //黑方用1来表示 system(&cls&); display();}void red()
//红方落子{ cout&&&请红方输入落子位置:\n&
&&&请输入落子的行数:&; cin&&m; cout&&&请输入落子的列数:&; cin&&n; if(m&=X||m&=0||n&=0||n&=Y) {
cout&&&超出棋盘范围,请重新输入正确坐标!\n&;
red(); } else if((p[m][n]==1)||p[m][n]==2) {
cout&&&该点已有棋子,请重新选取落子点!\n&;
red(); } else
p[m][n]=2; //红方用2来表示 system(&cls&); display();}int evalue()
//只需要判断落子点为中心的九点“米”字是否连续即可{ int k = 0,r = 0; /*斜线判断*/ for(k=3;k&X-2;k++)
//两条,其中的p[k][r]!='-'是排除空子的情况 {
for(r=3;r&Y-2;r++)
if(p[k][r]!='-'&&p[k-2][r-2]==p[k][r]&&p[k-1][r-1]==p[k][r]&&p[k+1][r+1]==p[k][r]&&p[k+2][r+2]==p[k][r])
else if(p[k][r]!='-'&&p[k+2][r-2]==p[k][r]&&p[k+1][r-1]==p[k][r]&&p[k-1][r+1]==p[k][r]&&p[k-2][r+2]==p[k][r])
} } /*横线判断*/ for(k=1;k&X;k++)
//p[k][r]!='-'是排除空子的情况
for(r=3;r&Y-2;r++)
if(p[k][r]!='-'&&p[k][r-2]==p[k][r]&&p[k][r-1]==p[k][r]&&p[k][r+1]==p[k][r]&&p[k][r+2]==p[k][r])
return 1; /*竖线判断*/ for(k=3;k&X-2;k++)
//p[k][r]!='-'是排除空子的情况
for(r=1;r&Y;r++)
if(p[k][r]!='-'&&p[k-2][r]==p[k][r]&&p[k-1][r]==p[k][r]&&p[k+1][r]==p[k][r]&&p[k+2][r]==p[k][r])
return 0; }int main(){ memset(p,'-',441);
//初始化为‘-’ cout&&&欢迎使用简易双人对战五子棋游戏\n&
&&&五子棋棋谱如下:\n&; display(); while(1) {
if(evalue())
cout&&&红方赢!\n&;
if(evalue())
cout&&&黑方赢!\n&;
} return 0;}人人对战五子棋
为什么初始化不行
1条折叠回答
其他2条回答
为你推荐:
其他类似问题
您可能关注的内容
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。C++程序设计:设计一个简单产品管理系统,求大神帮我看哪弄错了【c++吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:304,726贴子:
C++程序设计:设计一个简单产品管理系统,求大神帮我看哪弄错了收藏
#include&iostream.h&#include&windows.h&extern void function_h();int main(){ do {
desktop();
system("cls");
else if(n==2)
else if(n==3)
else if(n==4)
} } while(n!=0); return 0;}#include&iostream.h&#include&windows.h&struct product{ char name[10];}pro=[5]; void input(){ for(int i=0;i&5;i++) {
cout&&"请输入第"&&i+1&&"种产品的代码:";
cin&&pro[i].
cout&&"请输入第"&&i+1&&"种产品的名称:";
cin&&pro[i].
cout&&"请输入第"&&i+1&&"种产品的数量:";
cin&&pro[i].
cout&&"请输入第"&&i+1&&"种产品的销售量:";
cin&&pro[i].
pro[i].stock=pro[i].amount-pro[i].
system("cls"); }}void sort(){ for(int i=0;i&5-1;i++)
for(int j=i+1;j&=5-1;j++)
if(pro[i].stock&pro[j].stock)
temp=pro[i];
pro[i]=pro[j];
for(int j=0;j&=5-1;j++)
cout&&"库存量排第"&&j++&&"种产品的库存为:"&&pro[j].stock&&
cout&&"代码是:"&&pro[j].code&&
cout&&"名称是:"&&pro[j].name&&
cout&&"数量是:"&&pro[j].amount&&
cout&&"销售量是:"&&pro[j].sales&&endl&&
system("pause");
system("cls");}void search(){ int code[5]={1,2,3,4,5}; bool flag=0; cout&&"请输入要查询的代码:"; cin&&b; for(int i=0;i&5;++i)
if(b==pro[i].code)
cout&&"产品代码:"&&pro[i].code&&""
&&"名称:"&&pro[i].name&&""
&&"数量:"&&pro[i].amount&&""
&&"销售量:"&&pro[i].sales&&
if(flag==0)
cout&&"此代码为无效代码!!!请重输!"&&
system("pause");
system("cls");}void reput(){ cout&&"已输入产品代码分别为:"&& for(int k=0;k&=5-1;k++)
cout&&pro[k].code&& cout&&"你要修改的产品代码是多少?"&& cin&& for(int i=0;i&=4;i++) {
if(pro[i].code==code) } if(i==5)
cout&&"没有你要修改的产品!"&& else {
cout&&"请输入你要修改的产品代码:"&&
cin&&pro[i].
cout&&"请输入你要修改的产品名称:"&&
cin&&pro[i].
cout&&"请输入你要修改的产品数量:"&&
cin&&pro[i].
cout&&"请输入你要修改的产品销售量:"&&
cin&&pro[i].
pro[i].stock=pro[i].amount-pro[i]. } system("pause"); system("cls");}void desktop(){ cout&& cout&&"★★★★★★★★★欢迎进入产品管理系统★★★★★★★★★"&& cout&&"★★★★
请选择你要的服务
★★★★"&& cout&&"★★★★
1.输入产品信息
★★★★"&& cout&&"★★★★
2.查看产品信息
★★★★"&& cout&&"★★★★
3.查找产品信息
★★★★"&& cout&&"★★★★
4.修改产品信息
★★★★"&& cout&&"★★★★
0.退出系统....
★★★★"&& cout&&"★★★★★★★★★★★★★★★★★★★★★★★★★★★★"&& cout&& cout&&"请输入相应的代码:";}
--------------------Configuration: Main - Win32 Debug--------------------Compiling...Main.cppc:\users\administrator\desktop\01\main.cpp(9) : error C2065: 'desktop' : undeclared identifierc:\users\administrator\desktop\01\main.cpp(14) : error C2065: 'input' : undeclared identifierc:\users\administrator\desktop\01\main.cpp(18) : error C2065: 'sort' : undeclared identifierc:\users\administrator\desktop\01\main.cpp(22) : error C2065: 'search' : undeclared identifierc:\users\administrator\desktop\01\main.cpp(26) : error C2065: 'reput' : undeclared identifierc:\users\administrator\desktop\01\main.cpp(41) : error C2059: syntax error : '['c:\users\administrator\desktop\01\main.cpp(44) : error C2373: 'input' : different type modifiersc:\users\administrator\desktop\01\main.cpp(48) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(48) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(50) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(50) : error C2228: left of '.name' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(52) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(52) : error C2228: left of '.amount' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(54) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(54) : error C2228: left of '.sales' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(55) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(55) : error C2228: left of '.stock' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(55) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(55) : error C2228: left of '.amount' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(55) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(55) : error C2228: left of '.sales' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(60) : error C2373: 'sort' : different type modifiersc:\users\administrator\desktop\01\main.cpp(64) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(64) : error C2228: left of '.stock' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(64) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(64) : error C2228: left of '.stock' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(66) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(67) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(67) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(68) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(72) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(72) : error C2228: left of '.stock' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(73) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(73) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(74) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(74) : error C2228: left of '.name' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(75) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(75) : error C2228: left of '.amount' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(76) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(76) : error C2228: left of '.sales' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(82) : error C2373: 'search' : different type modifiersc:\users\administrator\desktop\01\main.cpp(89) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(89) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(92) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(92) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(93) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(93) : error C2228: left of '.name' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(94) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(94) : error C2228: left of '.amount' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(95) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(95) : error C2228: left of '.sales' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(103) : error C2373: 'reput' : different type modifiersc:\users\administrator\desktop\01\main.cpp(107) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(107) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(112) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(112) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(119) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operator
c:\users\administrator\desktop\01\main.cpp(119) : error C2228: left of '.code' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(121) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(121) : error C2228: left of '.name' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(123) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(123) : error C2228: left of '.amount' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(125) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(125) : error C2228: left of '.sales' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(126) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(126) : error C2228: left of '.stock' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(126) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(126) : error C2228: left of '.amount' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(126) : error C2676: binary '[' : 'struct product' does not define this operator or a conversion to a type acceptable to the predefined operatorc:\users\administrator\desktop\01\main.cpp(126) : error C2228: left of '.sales' must have class/struct/union typec:\users\administrator\desktop\01\main.cpp(132) : error C2373: 'desktop' : different type modifiers执行 cl.exe 时出错. Main.obj - 1 error(s), 0 warning(s)出现了这么多错误 我都看不懂 = = 求大神指教
没有包含某些头文件吧
两个文件?给第二个文件写一个头文件,然后 include 到第一个文件
登录百度帐号

我要回帖

更多关于 大神教你几个简单步骤把各种沙滩巾 的文章

 

随机推荐