Click here to Skip to main content
13,804,094 members

C / C++ / MFC

 
GeneralRe: SMS Access Pin
Bram van Kampen3-Dec-18 15:52
memberBram van Kampen3-Dec-18 15:52 
GeneralRe: SMS Access Pin
leon de boer3-Dec-18 16:46
memberleon de boer3-Dec-18 16:46 
GeneralRe: SMS Access Pin
Richard MacCutchan3-Dec-18 22:49
protectorRichard MacCutchan3-Dec-18 22:49 
QuestionUsing a selection Pin
_Flaviu2-Dec-18 3:56
member_Flaviu2-Dec-18 3:56 
AnswerRe: Using a selection Pin
Victor Nijegorodov2-Dec-18 10:12
memberVictor Nijegorodov2-Dec-18 10:12 
GeneralRe: Using a selection Pin
_Flaviu3-Dec-18 0:24
member_Flaviu3-Dec-18 0:24 
QuestionTesting a CGI Pin
Bram van Kampen1-Dec-18 15:26
memberBram van Kampen1-Dec-18 15:26 
QuestionString In C++ Pin
Hack Baba1-Dec-18 4:30
memberHack Baba1-Dec-18 4:30 
Plz Help Me, I am trying to make a school project which is a search engine that takes input from the user and searches the entered word or sentence within the files available. There's no compile error in the program but the program is not searching correctly the file which has the data. If the entered string matches any sentence or string in the file stored then it should display the result.
But the problem is that the strcmp or stricmp or any function which searches for a match is not working.
I am using it with if & else statement for now... If the string is in the file then it should show found else not found but it only works if there is only one word in the file. If the file which is to be searched has lots of data off course in the text format it always shows not found but if it has only one word then it says found. Plz help Me If You Can.
void search()
{

char str2[100];

char str[100];

cout<<"write some text to search:";

gets(str);

ifstream i;

i.open("stud.txt");

while(!i.eof())
{
i>>str;
}

    if(stricmp(str,str2)==0)

	 cout<<"found !";

    else

	 cout<<"not found !";

getch();

}


modified 1-Dec-18 11:37am.

QuestionRe: String In C++ Pin
CPallini1-Dec-18 5:49
mvpCPallini1-Dec-18 5:49 
AnswerRe: String In C++ Pin
Joe Woodbury1-Dec-18 8:03
professionalJoe Woodbury1-Dec-18 8:03 
GeneralRe: String In C++ Pin
Hack Baba2-Dec-18 22:54
memberHack Baba2-Dec-18 22:54 
GeneralRe: String In C++ Pin
jeron13-Dec-18 6:44
memberjeron13-Dec-18 6:44 
GeneralRe: String In C++ Pin
Hack Baba4-Dec-18 6:57
memberHack Baba4-Dec-18 6:57 
GeneralRe: String In C++ Pin
Hack Baba4-Dec-18 7:02
memberHack Baba4-Dec-18 7:02 
Questionstring array ? Pin
Vaclav_29-Nov-18 6:34
memberVaclav_29-Nov-18 6:34 
AnswerRe: string array ? Pin
Daniel Pfeffer29-Nov-18 6:59
professionalDaniel Pfeffer29-Nov-18 6:59 
GeneralRe: string array ? Pin
Vaclav_29-Nov-18 7:14
memberVaclav_29-Nov-18 7:14 
GeneralRe: string array ? Pin
leon de boer29-Nov-18 15:59
memberleon de boer29-Nov-18 15:59 
Questionabout deep learn Pin
Member 1406444226-Nov-18 20:08
memberMember 1406444226-Nov-18 20:08 
AnswerRe: about deep learn Pin
CPallini26-Nov-18 21:57
mvpCPallini26-Nov-18 21:57 
GeneralRe: about deep learn Pin
David Crow27-Nov-18 4:42
memberDavid Crow27-Nov-18 4:42 
GeneralRe: about deep learn Pin
CPallini27-Nov-18 12:47
mvpCPallini27-Nov-18 12:47 
QuestionDisplay tooltip for each listbox item on combobox using ctooltipctrl Pin
Member 1031536521-Nov-18 7:29
professionalMember 1031536521-Nov-18 7:29 
AnswerRe: Display tooltip for each listbox item on combobox using ctooltipctrl Pin
Victor Nijegorodov22-Nov-18 0:49
memberVictor Nijegorodov22-Nov-18 0:49 
GeneralRe: Display tooltip for each listbox item on combobox using ctooltipctrl Pin
Member 1031536525-Nov-18 22:37
professionalMember 1031536525-Nov-18 22:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.181218.1 | Last Updated 19 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid