Function code can't make use of variables in main...

Am I correct to assume that you want your variables "snailname, minutes and legtotal" from main and into your function?

Either you simply send them as is to your function.

Qualify(snailname, minutes, legtotal); 

and then in your function you need to receive as Qualify(char snailname, int minutes, int legtotal)

This allows you to do calculations inside your function and return one value at the end of it.

If you want to "send" variables into your function and manipulate their values and have them persist once your function is done you need to use pointers. In that case you want to send the adress of your variable instead of the entire variable in your function call. You do this like this: Qualify(&minutes, &legtotal); Qualify(int *minutes, int *legtotal) { //code }

/r/C_Programming Thread Parent