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

C / C++ / MFC

 
AnswerRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 10:02
professionalJoe Woodbury4-Dec-18 10:02 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 13:33
memberVaclav_4-Dec-18 13:33 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 13:36
professionalJoe Woodbury4-Dec-18 13:36 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 16:15
memberVaclav_4-Dec-18 16:15 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 19:48
professionalJoe Woodbury4-Dec-18 19:48 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_5-Dec-18 5:35
memberVaclav_5-Dec-18 5:35 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Richard MacCutchan4-Dec-18 23:00
protectorRichard MacCutchan4-Dec-18 23:00 
QuestionString Search In C++ Pin
Hack Baba4-Dec-18 7:07
memberHack Baba4-Dec-18 7:07 
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.
Also plz tell me how can i do the same thing which is to search for a particular entered word in more than one file like for example 10-20 files and then after searching it should display the whole line in the file or (files) found. Thanks For Your Help In Advance. I appreciate it !
Here's the code for searching the word in one file.
Plz also tell me how to search for the entered word in multiple files.

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>>str2;


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

	 cout<<"found !";

    else

	 cout<<"not found !";
}

getch();

}

AnswerRe: String Search In C++ Pin
jeron14-Dec-18 7:10
memberjeron14-Dec-18 7:10 
GeneralRe: String Search In C++ Pin
Hack Baba4-Dec-18 7:21
memberHack Baba4-Dec-18 7:21 
GeneralRe: String Search In C++ Pin
jeron14-Dec-18 8:49
memberjeron14-Dec-18 8:49 
AnswerRe: String Search In C++ Pin
Richard MacCutchan4-Dec-18 7:33
protectorRichard MacCutchan4-Dec-18 7:33 
GeneralRe: String Search In C++ Pin
Hack Baba4-Dec-18 7:45
memberHack Baba4-Dec-18 7:45 
GeneralRe: String Search In C++ Pin
Richard MacCutchan4-Dec-18 9:49
protectorRichard MacCutchan4-Dec-18 9:49 
AnswerRe: String Search In C++ Pin
Joe Woodbury4-Dec-18 10:04
professionalJoe Woodbury4-Dec-18 10:04 
GeneralRe: String Search In C++ Pin
Hack Baba5-Dec-18 0:58
memberHack Baba5-Dec-18 0:58 
GeneralRe: String Search In C++ Pin
Joe Woodbury5-Dec-18 7:21
professionalJoe Woodbury5-Dec-18 7:21 
SuggestionRe: String Search In C++ Pin
David Crow5-Dec-18 3:54
memberDavid Crow5-Dec-18 3:54 
QuestionCComobox::DrawItem list box entries Disappears In Release Mode Pin
ForNow3-Dec-18 17:10
memberForNow3-Dec-18 17:10 
AnswerRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
leon de boer3-Dec-18 18:43
memberleon de boer3-Dec-18 18:43 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
ForNow4-Dec-18 2:44
memberForNow4-Dec-18 2:44 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
leon de boer4-Dec-18 8:41
memberleon de boer4-Dec-18 8:41 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
Victor Nijegorodov4-Dec-18 9:27
memberVictor Nijegorodov4-Dec-18 9:27 
AnswerRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
Victor Nijegorodov3-Dec-18 21:27
memberVictor Nijegorodov3-Dec-18 21:27 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
ForNow4-Dec-18 2:46
memberForNow4-Dec-18 2:46 

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
Web05 | 2.8.181218.1 | Last Updated 19 Dec 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid