Compile Error
foo.c: In function 'main': foo.c:15:12: error: too few arguments to function 'strcmp' 15 | if(strcmp((name,p)==0)){ | ^~~~~~ In file included from foo.c:2: /usr/include/string.h:156:12: note: declared here 156 | extern int strcmp (const char *__s1, const char *__s2) | ^~~~~~
Code
#include <stdio.h>
#include <string.h>
int main(){
int t;
scanf("%d",&t);
while(t--){
int M;
scanf("%d",&M);
int N;
char name[N];
scanf("%s",name);
char p[20];
if(strcmp((name,p)==0)){
printf("Welcome!");
}
else{
printf("Sorry, not on the list.");
}
}
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1227 LUCC Party Check-in
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2025-09-01 06:24:01
- Judged At
- 2025-09-01 06:24:01
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes