when I use gcc to compile this .c file, there's no exception, but when I use g++ to compile, it throw below error:
ch.c: In function `int get(int*)':
ch.c:5: error: ISO C++ forbids comparison between pointer and integer
ch.c:5: error: operands to ?: have different types
the code is as below:
int get(int *ot){
int a=10;
int c=0;
c=(ot>a?ot:a);
return c;
}
int main(){
int t=1000;
int cc=0;
cc=get(&t);
return 0;
}
how can I do if need g++ to compile this .c file? thanks.