W
Walter Roberson
complex answers for a simple problem. Solution is:-
The solution for what? It's better to quote context, as most of us
do NOT use google groups to read postings.
int main(void)
{
char *name = "member";
int len = strlen(name);
strlen() is not prototyped without said:int i;
len-=1;
char tmp; //single variable
Using // is not valid in C89.
Making a declaration after an executable statement is not valid in C89.
for (i=0; i<=len; i++,--len)
{
tmp = name;
name = name[len]
Missing semicolon is not valid in C89 or C99.
Writing to a string literal is implementation defined in C89 and C99.
name[len] = tmp;
}
Failure to return a value from main is implementation defined in C89.
All variables go out of scope at this point, but nothing in this
code has produced any side-effect such as I/O. The compiler could
potentially optimize all the code out entirely.
complex answers for a simple problem. Solution is:-
Looks like that wasn't the solution after all. Was this due to a
misundertanding of the problem, or due to a misunderstanding of how
to program in C ?