Hello,
I've an problem whit understanding why i can't make an scanf() work inside an custom function.
This is the programing:
PHP Code:
int main(int argc, char** argv) {
int scan();
return (EXIT_SUCCESS);
}
int scan(){
int number;
scanf("%d", &number);
printf("%d\n", number);
}
As you can see i've made main call the scan function which should promote the user to type in but it just skips it. The program works if i just make the scanf inside of main but not when it's called via an function.
How should i do in order to get this to work?
Thank you for your time.