How to use a function containing scanf() in the main function in C
问题 The title describes what I'm trying to do, but I'm getting the error message that I never declared base1. I actually know this, but I'm not exactly sure how to actually fix the problem. int getBase1(void); int setBase1(double); int main(void){ getBase1(); setBase1(base1); } int getBase1(void){ printf("Please enter the length of a base: "); return; } int setBase1(double base1){ scanf("%lf", &base1); } 回答1: You must use pointer, otherwise the variable inside the method will not point to the