L
linq936
Hi,
I just did the following test:
1:void main(void){
2: int p = 1;
3: int* pp = &p;
4: int c = p * pp;
5: int d = p + pp;
6:}
I use GCC compiler and get the error and warning:
t2.c: In function `main':
t2.c:4: invalid operands to binary *
t2.c:5: warning: initialization makes integer from pointer without a
cast
t2.c:1: warning: return type of `main' is not `int'
You can see that operands in addition operation can be int* but not
in multiplication.
I checked my <<C programming language>>, it does not say anything on
operands. Is there any good web resource on such specification?
I just did the following test:
1:void main(void){
2: int p = 1;
3: int* pp = &p;
4: int c = p * pp;
5: int d = p + pp;
6:}
I use GCC compiler and get the error and warning:
t2.c: In function `main':
t2.c:4: invalid operands to binary *
t2.c:5: warning: initialization makes integer from pointer without a
cast
t2.c:1: warning: return type of `main' is not `int'
You can see that operands in addition operation can be int* but not
in multiplication.
I checked my <<C programming language>>, it does not say anything on
operands. Is there any good web resource on such specification?