Quote:
Originally posted by guest
...even then however you cannot assign one string to another as you try in main() with the lines:
a = foo1();
b = foo2();
you must use strcpy() as you did within foo1() and foo2().
Remember when you declare a char * it can be either a pointer to a single char or a pointer to the first char in a c_style string that can be used as a string. You can't tell which it is until you initialize it or assign memory to it. Pointers are very powerful and flexible entities, but they also require a lot of "work" by the programmer.
Not necessarily; foo1/foo2 returns a pointer to a string (assuming it worked), so: