S
starket
Hi folks,
I'm new to programming, please help,
char * b, q, *r;
b=getbuf();
q = *b;
r= anotherfunction(b);
/* we want to use ‘q' and ‘r' here*/
char * getbuf()
{
char buff[8];
/* unspecified, buff defined here *./
return (char *) buff;
}
1) what's in q?
2) is getbuf() a valid function? will it be executed? what it
returns?
3) How, exactly, could one get a second ‘char *' to use back from this
function or how can this function be modified to return a ‘char *'
(that is, it maintains the same return type) from the function, and an
additional ‘char *' value in one function call?
Many thanks,
starket
I'm new to programming, please help,
char * b, q, *r;
b=getbuf();
q = *b;
r= anotherfunction(b);
/* we want to use ‘q' and ‘r' here*/
char * getbuf()
{
char buff[8];
/* unspecified, buff defined here *./
return (char *) buff;
}
1) what's in q?
2) is getbuf() a valid function? will it be executed? what it
returns?
3) How, exactly, could one get a second ‘char *' to use back from this
function or how can this function be modified to return a ‘char *'
(that is, it maintains the same return type) from the function, and an
additional ‘char *' value in one function call?
Many thanks,
starket