0
why this function returns n ?
I have this example : #include <stdio.h> #include <cs50.h> int get_positive_int (void); int main (void) { get_positive_int(); } int get_positive_int ( void) { int n; do { n=get_int("insert positive:"); } while (n<1); return n; } I still don#t get why this function gives out n ? when the programm is running it doesn't give out integer
2 Answers
0
Have you declared the get_int function? I can see no user input function here...
0
yes it is declared in cs50 library.. yes as the example says it doesn't get input..it only gives Output...but why ? since the user should enter an int.