error C2100: illegal indirection

本文分析了C++编程中常见的C2100编译错误,详细解释了错误产生的原因,并通过具体示例展示了如何避免此类错误。此外,还介绍了正确的平方运算表达方式。

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

// error C2100: illegal indirection

一、 如果把一个实变量当作一个指针赋值,则产生C2100编译错误:

// C2100.cpp
int main() {
   int r = 0, *s = 0;
   *r = 200;   // C2100
   // try 
   // *s = 200;
}

二、 这里是因为C++中没有**2这样的平方表示方式,应改为pow()函数表达。

pulse = exp(-0.5*((t0 - n)**2 / w*w));   

Error using loadlibrary Building ueye_thunk_pcwin64 failed. Compiler output is: cl -I"C:\Program Files\MATLAB\R2024b\extern\include" /Zc:__cplusplus /Zp8 /W3 /nologo -I"C:\Users\bio\Desktop\Zhenyu" -I"C:\Program Files\IDS\uEye\develop\include" "ueye_thunk_pcwin64.c" -LD -Fe"ueye_thunk_pcwin64.dll" ueye_thunk_pcwin64.c ueye_thunk_pcwin64.c(567): error C2059: syntax error: ')' ueye_thunk_pcwin64.c(567): error C2061: syntax error: identifier 'INT__cdeclis_ExitImageQueue' ueye_thunk_pcwin64.c(567): error C2059: syntax error: ';' ueye_thunk_pcwin64.c(568): error C2143: syntax error: missing ')' before '{' ueye_thunk_pcwin64.c(569): error C2059: syntax error: ')' ueye_thunk_pcwin64.c(569): error C2065: 'deprecated': undeclared identifier ueye_thunk_pcwin64.c(569): error C2146: syntax error: missing ';' before identifier 'INT' ueye_thunk_pcwin64.c(569): error C2275: 'INT': expected an expression instead of a type ueye_thunk_pcwin64.c(569): error C2143: syntax error: missing ';' before '__cdecl' ueye_thunk_pcwin64.c(570): error C2065: 'p0': undeclared identifier ueye_thunk_pcwin64.c(570): error C2065: 'deprecated': undeclared identifier ueye_thunk_pcwin64.c(570): error C2100: you cannot dereference an operand of type 'int' ueye_thunk_pcwin64.c(570): error C2146: syntax error: missing ';' before identifier 'INT' ueye_thunk_pcwin64.c(570): error C2275: 'INT': expected an expression instead of a type ueye_thunk_pcwin64.c(570): error C2143: syntax error: missing ';' before '__cdecl' ueye_thunk_pcwin64.c(571): error C2065: 'p0': undeclared identifier ueye_thunk_pcwin64.c(571): error C2065: 'p0': undeclared identifier ueye_thunk_pcwin64.c(571): error C2065: 'p0': undeclared identifier ueye_thunk_pcwin64.c(572): error C2059: syntax error: ')' Error in control (line 9) loadlibrary(dllPath, headerPath, 'alias', 'ueye'); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>
最新发布
07-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值