C , Error: Expression must be a modifiable lvalue

Islam Wahdan

i have the following code:

#define NULL ((void*)0)
void* Globalptr = NULL;
void func(ptrtype* input)
{
 ((ptrtype*)Globalptr) = input;
}

I get Error on line ((ptrtype*)Globalptr) = input; says " expression must be a modifiable lvalue"

user694733

You must make the data to match the variable (lvalue), and not change the type of the variable to match the data:

Globalptr = (void*)input;

But since you can convert any data pointer to void* in C, you can simply do:

Globalptr = input;

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

error: expression must have integral or enum type

来自分类Dev

Expression must have a pointer to object type in C

来自分类Dev

C结构取消引用需要Lvalue

来自分类Dev

C结构取消引用必需的Lvalue

来自分类Dev

C# - Left Outer Join lambda expression error

来自分类Dev

Weird compilation error: catastrophic error: section length mismatch in array expression compilation aborted for shocktube.c

来自分类Dev

如何从C ++中的rvalue和lvalue参数移开?

来自分类Dev

How is this C expression evaluated

来自分类Dev

lmer error: grouping factor must be < number of observations

来自分类Dev

Tensorflow error: Invalid argument: shape must be a vector

来自分类Dev

C ++ 11:为什么result_of可以接受函子类型作为lvalue_reference,但不能接受函数类型作为lvalue_reference?

来自分类Dev

C ++ 11:为什么result_of可以接受函子类型作为lvalue_reference,但不能接受函数类型作为lvalue_reference?

来自分类Dev

ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of database

来自分类Dev

出现错误:尝试在C中实现锯齿状数组时需要lvalue

来自分类Dev

C二进制运算符应用于LVALUE或RVALUE的宽度

来自分类Dev

需要LVALUE作为C程序中赋值的左操作数

来自分类Dev

Fatal error: Cannot use isset() on the result of an expression

来自分类Dev

Webpack 抛出 TypeError: Super expression must be null or a function, not undefined 导入 LESS 文件时

来自分类Dev

import React, {PropTypes} from 'react' 导致 Uncaught TypeError: Super expression must be null or a function, not undefined

来自分类Dev

Index and length must refer to a location within the string error in substring

来自分类Dev

Yii2 SluggableBehavior "attribute" or "value" property must be specified error

来自分类Dev

Lvalue to rvalue reference binding

来自分类Dev

使用C#Expression Evaluator过滤列表

来自分类Dev

像C#中的Expression.Like

来自分类Dev

像C#中的Expression.Like

来自分类Dev

在C#中调用方法Expression Tree

来自分类Dev

"parsing expression" error when using the Info button for an array element in Xcode

来自分类Dev

无法识别 Text.InferNumberType 的 Expression.Error

来自分类Dev

Android : Error com.parse.ParseException: at least one ID field (installationId,deviceToken) must be specified in this operation

Related 相关文章

  1. 1

    error: expression must have integral or enum type

  2. 2

    Expression must have a pointer to object type in C

  3. 3

    C结构取消引用需要Lvalue

  4. 4

    C结构取消引用必需的Lvalue

  5. 5

    C# - Left Outer Join lambda expression error

  6. 6

    Weird compilation error: catastrophic error: section length mismatch in array expression compilation aborted for shocktube.c

  7. 7

    如何从C ++中的rvalue和lvalue参数移开?

  8. 8

    How is this C expression evaluated

  9. 9

    lmer error: grouping factor must be < number of observations

  10. 10

    Tensorflow error: Invalid argument: shape must be a vector

  11. 11

    C ++ 11:为什么result_of可以接受函子类型作为lvalue_reference,但不能接受函数类型作为lvalue_reference?

  12. 12

    C ++ 11:为什么result_of可以接受函子类型作为lvalue_reference,但不能接受函数类型作为lvalue_reference?

  13. 13

    ActiveRecord::StatementInvalid: PG::Error: ERROR: must be owner of database

  14. 14

    出现错误:尝试在C中实现锯齿状数组时需要lvalue

  15. 15

    C二进制运算符应用于LVALUE或RVALUE的宽度

  16. 16

    需要LVALUE作为C程序中赋值的左操作数

  17. 17

    Fatal error: Cannot use isset() on the result of an expression

  18. 18

    Webpack 抛出 TypeError: Super expression must be null or a function, not undefined 导入 LESS 文件时

  19. 19

    import React, {PropTypes} from 'react' 导致 Uncaught TypeError: Super expression must be null or a function, not undefined

  20. 20

    Index and length must refer to a location within the string error in substring

  21. 21

    Yii2 SluggableBehavior "attribute" or "value" property must be specified error

  22. 22

    Lvalue to rvalue reference binding

  23. 23

    使用C#Expression Evaluator过滤列表

  24. 24

    像C#中的Expression.Like

  25. 25

    像C#中的Expression.Like

  26. 26

    在C#中调用方法Expression Tree

  27. 27

    "parsing expression" error when using the Info button for an array element in Xcode

  28. 28

    无法识别 Text.InferNumberType 的 Expression.Error

  29. 29

    Android : Error com.parse.ParseException: at least one ID field (installationId,deviceToken) must be specified in this operation

热门标签

归档