What and why is wrong in these ads? (Ads are independent)
int var; int *iptr =&ivar; int ivar, *iptr=&ivar; float fvar; int *iptr=&fvar; int nums[50], *iptr=nums; int ivar, *iptr; *iptr = &ivar;
Thank.
What and why is wrong in these ads? (Ads are independent)
int var; int *iptr =&ivar; int ivar, *iptr=&ivar; float fvar; int *iptr=&fvar; int nums[50], *iptr=nums; int ivar, *iptr; *iptr = &ivar;
Thank.
int var; int * iptr = & ivar;
here it is commonplace - ivar
not declared.
int ivar, *iptr=&ivar;
here, except the use of the uninitialized variable ivar
.
float fvar; int *iptr=&fvar;
different types - pointer to integer and pointer to real.
int nums[50], *iptr=nums;
nums is actually a pointer, it will compile. And it will work. But apparently it means that there are "different types".
int ivar, *iptr; *iptr = &ivar;
Here *iptr
is already a name. *iptr
is an integer type. And trying to assign an address.
Source: https://ru.stackoverflow.com/questions/163902/
All Articles