Category:C: Difference between revisions

Content added Content deleted
Line 49: Line 49:
void PlaySound(char songName) //This takes a character string as an argument and presumably sends a command to sound hardware.
void PlaySound(char songName) //This takes a character string as an argument and presumably sends a command to sound hardware.
//It returns no values. Functions that have a return value of "void" typically do some sort of procedure whose outcome does not need to be
//It returns no values. Functions that have a return value of "void" typically do some sort of procedure whose outcome does not need to be
//measured later.
//measured later.</lang>

Note that the variable names listed as arguments when declaring a function are just for convenience. They need not be declared nor defined, nor do they refer to any variables in your program that happen to have the same name. It's only when a function is actually <i>used</i> are the argument variables required to exist.
Note that the variable names listed as arguments when declaring a function are just for convenience. They need not be declared nor defined, nor do they refer to any variables in your program that happen to have the same name. It's only when a function is actually <i>used</i> are the argument variables required to exist.
<lang C>int foo(int x){
<lang C>int foo(int x){