Borderou de evaluare (job #822704)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Poziții (clasa a 5-a) | Compilator | c-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 6 mai 2025 19:14:38 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.c: In function 'main':
main.c:10:12: error: passing argument 1 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
10 | fscanf("%d %d", &n, &poz);
| ^~~~~~~
| |
| char *
In file included from main.c:1:
/usr/include/stdio.h:422:37: note: expected 'FILE *' but argument is of type 'char *'
422 | extern int fscanf (FILE *__restrict __stream,
| ~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:10:21: error: passing argument 2 of 'fscanf' from incompatible pointer type [-Wincompatible-pointer-types]
10 | fscanf("%d %d", &n, &poz);
| ^~
| |
| int *
/usr/include/stdio.h:423:43: note: expected 'const char *' but argument is of type 'int *'
423 | const char *__restrict __format, ...) __wur __nonnull ((1));
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:12:7: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
12 | for(int i=0;i<n;i++);{
| ^~~
main.c:12:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
12 | for(int i=0;i<n;i++);{
| ^
main.c:10:5: warning: ignoring return value of 'fscanf' declared with attribute 'warn_unused_result' [-Wunused-result]
10 | fscanf("%d %d", &n, &poz);
| ^~~~~~~~~~~~~~~~~~~~~~~~~