Two declarationsof the same object or function specify types that are not compatible(6.2.7).

char c = 'a';
char *pc = &c;
int *pi;
void *pv;
pi
= pv = pc; //这里没有编译错误或警告
//pv = pi =pc; //这样写的话会有一个warning a value of type "char *" cannot be assigned to an entity of type "int *"
*pi = 10; //undefined behavior

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-06-25
  • 2021-08-15
猜你喜欢
  • 2021-11-28
  • 2022-02-11
  • 2021-10-03
  • 2022-03-08
  • 2021-08-17
  • 2021-10-20
  • 2021-11-30
相关资源
相似解决方案