Hi,
I tried the following simple code segment in gcc and it gave the
incompatible type error as mentioned below.
int main() {
int arr[10];
arr = arr; // error: incompatible types when assigning to type
‘int[10]’ from type ‘int *’
}
Here it seems GCC is retaining the left hand side
Hi,
I tried the following simple code segment in gcc and it gave the
incompatible type error as mentioned below.
int main() {
int arr[10];
arr = arr; // error: incompatible types when
// assigning to type ‘int[10]’ from type ‘int *’
}
Here it seems GCC is retaining the left
According to 6.3.2.1 Para 3, the type conversion from array of type
to pointer to type should
happen irrespective of whether the operand is on right had side or the
left hand side of assignment
operator. But GCC is converting only the right side operator type to
pointer of type while retaining the
On Sat, Jul 18, 2009 at 2:18 PM, dharmendra
panditpandit.dharmen...@gmail.com wrote:
According to 6.3.2.1 Para 3, the type conversion from array of type
to pointer to type should
happen irrespective of whether the operand is on right had side or the
left hand side of assignment
operator. But
Here it seems GCC is retaining the left hand side type of arr to be
array of 10 ints whereas on the right hand side
it has changed its type from array to pointer to integer. I tried
And rightly so.
searching the relevant sections in the standard ISO C
document number WG14/N1124 justifying