Hi uma,

#include <stdio.h>

int main(int argc, char *argv[]) {
int *a;
int **b;
int *c;

c = (int *)a;
b = &c;

return 0;
}

This seems to work why?

thanks,

SMS

On Sat, Jul 18, 2009 at 2:01 PM, uma <u...@twincling.org> wrote:

>
>
> Hi Saifi,
>
> The following line should give compiler error
> b = &(int *)a;
>
> '&' operator expects operand immediately, but not typecast operator or any
> other expression.
>
> It could be corrected as:
>
>
> #include <stdio.h>
>
> int main(int argc, char *argv[]) {
> char *a;
> int **b;
> int *c;
>
> c = (int *)a;
> b = &c;
>
> return 0;
> }
>
> But the operation is not portable.
>
> thanks,
> uma..
>
> On Sat, Jul 18, 2009 at 10:06 AM, Saifi Khan 
> <saifi.k...@twincling.org<saifi.khan%40twincling.org>
> >wrote:
>
> > Hi all:
> >
> > Here is a simple C code.
> >
> > #include <stdio.h>
> >
> > int main(int argc, char *argv[])
> > {
> > char *a;
> >
> > int **b;
> >
> > b = &(int *)a;
> >
> > return 0;
> > }
> >
> >
> > --
> > any issues with this piece of code ?
> >
> >
> > thanks
> > Saifi.
> >
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]

Reply via email to