-2

我想知道以下表达式的含义是什么:

unsigned char *buff_p = txBuffer, hdrFlags, msgType;
4

2 回答 2

5

该行声明了三个变量并分配了其中一个。

就像

int a = 1, b, c;

这与

int b, c, a = 1;

换句话说,=优先级高于,.

于 2013-05-07T16:31:39.560 回答
0

该行只进行了一次赋值并声明了其他两个变量。

unsigned char *buff_p = txBuffer, hdrFlags, msgType;
// buff_p points to txtBuffer
// other vars, they are of type char*

它类似于char one, two, three;仅对声明的变量之一进行赋值(我没有为此使用指针,因为可能会增加一些混乱)。

于 2013-05-07T16:41:21.767 回答