Saturday, 14 September 2013

main arguments and functions in c

main arguments and functions in c

int multiply(int n){
doenstwork = n * 2
return doesntwork;
int main(int argc, char *argv[]){
int n;
n = atoi(argv[1]);
return multiply(n);
}
I have been sitting for hours and trying to figure out how c handles
argument and how functions work. I wrote this code and don´t have any idea
why it doesn´t work.
I really want to make friends with c but it seems not to like me or maybe
I'm not trying hard enough;) Please make me think the right way.

No comments:

Post a Comment