Welcome, Guest. Please login or register.

Author Topic: Mr. Biehl learns C  (Read 7248 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline MskoDestny

  • Sr. Member
  • ****
  • Join Date: Oct 2004
  • Posts: 363
    • Show all replies
    • http://www.retrodev.com
Re: Mr. Biehl learns C
« on: April 07, 2005, 03:33:12 AM »
Another use is to allow a function to modify values from the calling function.  This can be useful when you need to return more than one value or you need to return a large structure or an array.

Also keep in mind that arrays are just pointers with some statically allocated memory set aside for them ahead of time.  Some examples:

char string1[] "Hello ";
char string2[] "World\n";
char * tmp;

tmp = string1;
string1 = string2;
string2 = tmp

printf("%s%s", string1, string2);

would print
World
Hello

string1[2] is equivalent to *(string1 + 2)