本帖最后由 zzz19760225 于 2024-8-31 13:28 编辑
求解,用中文作为变量名字,进行赋值操作?(扩大使用范围,在中文变量后面加数字编码,char 图片123,行不行?)
变量用中文,便于小白理解和记忆。
win10+vc6.0+easyx- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <windows.h>
- #include <graphics.h>
- #include<stdio.h>
- #include<string.h>
-
- #define 图片变量 "tupianbianliang"
-
- int main()
- {
- initgraph(1200, 700);
- char 图片变量123=1.jpg;
-
- IMAGE img;
- loadimage(&img,图片变量123,1200,500);
- putimage(0, 0, &img);
- getch();
-
- closegraph();
- return 0;
- }
复制代码 编译通过,实际是上一个软件执行成功的影子,虚假的,换了一个新的,就显示各种错误- --------------------Configuration: a3b3 - Win32 Debug--------------------
-
- a3b3.exe - 0 error(s), 0 warning(s)
复制代码
- Deleting intermediate files and output files for project 'a3b3 - Win32 Debug'.
- --------------------Configuration: a3b3 - Win32 Debug--------------------
- Compiling...
- a1b18.cpp
- d:\dos\c\a1b18.cpp(9) : error C2007: #define syntax
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xcd'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xbc'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xc6'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xac'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xb1'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xe4'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xc1'
- d:\dos\c\a1b18.cpp(14) : error C2018: unknown character '0xbf'
- d:\dos\c\a1b18.cpp(14) : error C2513: 'char' : no variable declared before '='
- d:\dos\c\a1b18.cpp(14) : error C2059: syntax error : 'bad suffix on number'
- d:\dos\c\a1b18.cpp(14) : error C2146: syntax error : missing ';' before identifier 'jpg'
- d:\dos\c\a1b18.cpp(14) : error C2065: 'jpg' : undeclared identifier
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xcd'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xbc'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xc6'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xac'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xb1'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xe4'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xc1'
- d:\dos\c\a1b18.cpp(17) : error C2018: unknown character '0xbf'
- d:\dos\c\a1b18.cpp(17) : error C2059: syntax error : ','
- 执行 cl.exe 时出错.
-
- a3b3.exe - 1 error(s), 0 warning(s)
复制代码 不知道怎么,原本a3b3.hanzi,就打开来打开去的复制来复制去,变成只编译a1b18的文件了。
执行exe文件时(编辑器界面选择,实际debug文件夹里没有exe),
弹窗提示"The file does not exist. Do you want to build it?"(文件不存在。你想建造它吗?),
然后点击,弹窗“无法执行程序”。 |