i guess i'm not seeing it all just yet, because i don't fully understand why the prototype is "function(int *);" i'm doing it now cuz it works.
Well think about it, a function prototype defines the return type, name, and types of the values that function takes.
All those parameters are, are names for variables your function can use, who's value is initiialized on funciton call.
That's hard to bite, but read it a few times.
About header files: Try using a conforming compiler. MS has allready declared that they will not make one. Dev-C++ is good
i know u said 'int main()' before. right now, the professor wants it this way. we're not returning a code to the OS, so it really doesn't matter right now. (does it?)
Sure does, your shell wants that return value, and expects it. The C/C++ standard defines the 2 ways inwhich main will be defined, and both of those ways have a return value of int. In C++, they say you leavea bout the return statement though.
Example:
int main(void)
{
}
is valid. Even though there should be a return statement (with a value).
i know void functions don't need return. i don't think i was consistent, but i wanted the empty returns to be clear that no value was returned. i was told it's optional.
They probably mean the return type was optional. Everything defaults to an int in C/C++ (although not in the last standard, but anyways). So everything has a default type of int if not given.
Example:
main(void)
{
}
is the same as
int main(void)
{
}
u said 'you're not sure exactly what this is supposed to do...', but then you explain it anyway. so i'm figuring you get it.
i was just being a jerk.