#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void cari(void) {
FILE *text;
char *input;
char namafile[25];
printf("input your string :\n"); scanf("%s",input);
printf("\n");
printf("input your filename.txt :\n"); gets(text);
if ((text = fopen(namafile, "r")) != NULL) {
printf("[+]Searching\n");
printf("[+]Found\n");
printf("string : %s\n",&input);
printf("[+]Match In filename\n");
printf("%s",strcmp(input,&namafile);
}else if ((text = fopen(namafile,"r")) != NULL) {
printf("[+]Searching\n");
printf("[+]Not Found\n");
printf("string : %s\n",&input);
printf("[+]Not Match In filename\n");
printf("%s",strcmp(input,&namafile);
} else {
printf("kesalahan file bro");
exit(EXIT_FAILURE);
}
fclose(text);
return cari;
}
int main(void) {
cari();
return 0;
}
help me to fix it dude
this my error dude..
seacrh.c: In function ‘cari’: seacrh.c:13: warning: passing argument 1 of ‘fgets’ from incompatible pointer type seacrh.c:13: error: too few arguments to function ‘fgets’ seacrh.c:18: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char **’ seacrh.c:20: warning: passing argument 2 of ‘strcmp’ from incompatible pointer type seacrh.c:20: error: expected ‘)’ before ‘;’ token seacrh.c:21: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’ seacrh.c:21: error: expected ‘;’ before ‘}’ token seacrh.c:24: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char **’ seacrh.c:26: warning: passing argument 2 of ‘strcmp’ from incompatible pointer type seacrh.c:26: error: expected ‘)’ before ‘;’ token seacrh.c:27: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’ seacrh.c:27: error: expected ‘;’ before ‘}’ token seacrh.c:32: warning: ‘return’ with a value, in function returning void kiddies@ubuntu:~/c$ gcc -o seacrh seacrh.c seacrh.c: In function ‘cari’: seacrh.c:13: warning: passing argument 1 of ‘gets’ from incompatible pointer type seacrh.c:18: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char **’ seacrh.c:20: warning: passing argument 2 of ‘strcmp’ from incompatible pointer type seacrh.c:20: error: expected ‘)’ before ‘;’ token seacrh.c:21: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’ seacrh.c:21: error: expected ‘;’ before ‘}’ token seacrh.c:24: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char **’ seacrh.c:26: warning: passing argument 2 of ‘strcmp’ from incompatible pointer type seacrh.c:26: error: expected ‘)’ before ‘;’ token seacrh.c:27: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘int’ seacrh.c:27: error: expected ‘;’ before ‘}’ token seacrh.c:32: warning: ‘return’ with a value, in function returning void
i hope enlightenment for this...


Sign In
Create Account


Back to top









