Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Cは初めてで、次の機能があります。
void getNum(int *n) { scanf("%d", &n); }
そして主に:
int main() { int someNum; getNum(&someNum); return 0; }
このエラーの「int**」の部分は正確にはどこから来ているのでしょうか。また、物事をどのように渡すかについて他の問題がありますか?
唯一の問題は&nscanfに渡すことです:nはすでにポインターであるため、scanf呼び出しはそのポインターにポインターを渡しているため、警告が表示されます。
&n
n
scanf
使用する:scanf("%d", n);
scanf("%d", n);