Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Correcting this example depends on the intent of the programmer. If the intent is to modify the value of array and have that modification persist outside of the scope of init_array(), then the desired behavior can be achieved by declaring array elsewhere and passing it as an argument to init_array().

Code Block
bgColor#ccccff

int main(int argc, char *argv[]) {
   char array[10];
   init_array(array);
   /* ... */
   return 0;
}


void init_array(char array[]) {
   /* Initialize array */
   return;
}

...