义 unsigned char *pImage;报错错误: expected expression before ‘unsigned’

在C语言中,错误地尝试使用`unsigned char [10]`赋值给指针`pImage`会导致'expected expression before 'unsigned''的报错。正确的做法是在C++中使用`new`关键字,如`pImage = new unsigned char[100];`。但在C语言中,应该使用数组声明和初始化的方式,如`unsigned char pImage[100];`。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在c++中可以这么定义:

unsigned char *pImage;
pImage = new unsigned char[100];

C应该怎么写,我按照以下方式,报错
unsigned char *pImage;
  pImage = unsigned char[10];

错误: expected expression before ‘unsigned’

nsigned char *pImage;
pImage = new unsigned char[100];

C应该怎么写,我按照以下方式,报错
unsigned char *pImage;
  pImage = unsigned char[10];
错误: expected expression before ‘unsigned’

在c++中可以这么定义:

unsigned char *pImage;
pImage = new unsigned char[100];

C应该怎么写,我按照以下方式,报错
unsigned char *pImage;
  pImage = unsigned char[10];
错误: expected expression before ‘unsigned’

http://v.17173.com/playlist_16647084?retcode=0
http://v.17173.com/playlist_16646343?retcode=0
http://v.17173.com/playlist_16645606?retcode=0
http://v.17173.com/playlist_16644847?retcode=0
http://v.17173.com/playlist_16644531?retcode=0
http://v.17173.com/playlist_16643651?retcode=0
http://v.17173.com/playlist_16642300?retcode=0
http://v.17173.com/playlist_16641603?retcode=0
http://v.17173.com/playlist_16640802?retcode=0
http://v.17173.com/playlist_16639970?retcode=0
http://v.17173.com/playlist_16638879?retcode=0
http://v.17173.com/playlist_16637879?retcode=0
http://v.17173.com/playlist_16637129?retcode=0
http://v.17173.com/playlist_16636395?retcode=0
http://v.17173.com/playlist_16635430?retcode=0
http://v.17173.com/playlist_16634717?retcode=0
http://v.17173.com/playlist_16633978?retcode=0
http://v.17173.com/playlist_16633361?retcode=0
http://v.17173.com/playlist_16632679?retcode=0
http://v.17173.com/playlist_16631929?retcode=0
http://v.17173.com/playlist_16631235?retcode=0
http://v.17173.com/playlist_16630442?retcode=0
http://v.17173.com/playlist_16629659?retcode=0
http://v.17173.com/playlist_16628775?retcode=0
http://v.17173.com/playlist_16627962?retcode=0
http://v.17173.com/playlist_16626885?retcode=0
http://v.17173.com/playlist_16626031?retcode=0
http://v.17173.com/playlist_16625187?retcode=0
http://v.17173.com/playlist_16624338?retcode=0
http://v.17173.com/playlist_16623563?retcode=0
http://v.17173.com/playlist_16622782?retcode=0
http://v.17173.com/playlist_16621927?retcode=0
http://v.17173.com/playlist_16621058?retcode=0
http://v.17173.com/playlist_16620090?retcode=0
http://v.17173.com/playlist_16619172?retcode=0
http://v.17173.com/playlist_16618194?retcode=0
http://v.17173.com/playlist_16617354?retcode=0
http://v.17173.com/playlist_16616530?retcode=0
http://v.17173.com/playlist_16615706?retcode=0
http://v.17173.com/playlist_16614722?retcode=0
http://v.17173.com/playlist_16613787?retcode=0
http://v.17173.com/playlist_16613068?retcode=0
http://v.17173.com/playlist_16612261?retcode=0
http://v.17173.com/playlist_16611494?retcode=0
http://v.17173.com/playlist_16610758?retcode=0
http://v.17173.com/playlist_16609837?retcode=0
http://v.17173.com/playlist_16608681?retcode=0
http://v.17173.com/playlist_16607859?retcode=0
http://v.17173.com/playlist_16606880?retcode=0
http://v.17173.com/playlist_16605763?retcode=0
http://v.17173.com/playlist_16604378?retcode=0
http://ameblo.jp/ny6688/entry-11803647598.html
http://ameblo.jp/ny6688/entry-11803647598.html
http://ameblo.jp/ny6688/entry-11803647598.html
http://ameblo.jp/ny6688/entry-11803647598.html
http://ameblo.jp/ny6688/entry-11803647598.html
http://ameblo.jp/ny6688/entry-11803647598.html


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值