mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
replaced scanf with fscanf.
This commit is contained in:
parent
c7e552c448
commit
2e987df422
@ -131,7 +131,7 @@ int main(void) {
|
|||||||
// time constant:
|
// time constant:
|
||||||
printf("Enter the array size: "); // ask the user for an array size
|
printf("Enter the array size: "); // ask the user for an array size
|
||||||
int size;
|
int size;
|
||||||
scanf("%d", &size);
|
fscanf(stdin, "%d", &size);
|
||||||
char buf[size];
|
char buf[size];
|
||||||
fgets(buf, sizeof buf, stdin);
|
fgets(buf, sizeof buf, stdin);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user