English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

while(fgets(a,1024,pf)){
if(strcmp(a,b)){
printf(a);
}
}
i tried also
if(strcmp(a,b)!=0){
}

2007-06-16 08:02:13 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

Are you aware that fgets() includes the newline in the string? (gets() doesn't but fgets() does.)

So if you are looking for a line containing only "foo" you'd have to set b to "foo\n".

2007-06-16 08:31:25 · answer #1 · answered by McFate 7 · 0 0

Dam, your grammar is horrible.

2007-06-16 08:05:30 · answer #2 · answered by Andriyko Chuk 2 · 0 1

fedest.com, questions and answers