Click here to Skip to main content
15,879,613 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 9:02
professionalJoe Woodbury4-Dec-18 9:02 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 12:33
Vaclav_4-Dec-18 12:33 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 12:36
professionalJoe Woodbury4-Dec-18 12:36 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_4-Dec-18 15:15
Vaclav_4-Dec-18 15:15 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Joe Woodbury4-Dec-18 18:48
professionalJoe Woodbury4-Dec-18 18:48 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Vaclav_5-Dec-18 4:35
Vaclav_5-Dec-18 4:35 
GeneralRe: "undefined reference " error - what am I missing ? Pin
Richard MacCutchan4-Dec-18 22:00
mveRichard MacCutchan4-Dec-18 22:00 
QuestionString Search In C++ Pin
Hack Baba4-Dec-18 6:07
Hack Baba4-Dec-18 6: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 6:10
jeron14-Dec-18 6:10 
GeneralRe: String Search In C++ Pin
Hack Baba4-Dec-18 6:21
Hack Baba4-Dec-18 6:21 
GeneralRe: String Search In C++ Pin
jeron14-Dec-18 7:49
jeron14-Dec-18 7:49 
AnswerRe: String Search In C++ Pin
Richard MacCutchan4-Dec-18 6:33
mveRichard MacCutchan4-Dec-18 6:33 
GeneralRe: String Search In C++ Pin
Hack Baba4-Dec-18 6:45
Hack Baba4-Dec-18 6:45 
GeneralRe: String Search In C++ Pin
Richard MacCutchan4-Dec-18 8:49
mveRichard MacCutchan4-Dec-18 8:49 
AnswerRe: String Search In C++ Pin
Joe Woodbury4-Dec-18 9:04
professionalJoe Woodbury4-Dec-18 9:04 
GeneralRe: String Search In C++ Pin
Hack Baba4-Dec-18 23:58
Hack Baba4-Dec-18 23:58 
GeneralRe: String Search In C++ Pin
Joe Woodbury5-Dec-18 6:21
professionalJoe Woodbury5-Dec-18 6:21 
SuggestionRe: String Search In C++ Pin
David Crow5-Dec-18 2:54
David Crow5-Dec-18 2:54 
QuestionCComobox::DrawItem list box entries Disappears In Release Mode Pin
ForNow3-Dec-18 16:10
ForNow3-Dec-18 16:10 
AnswerRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
leon de boer3-Dec-18 17:43
leon de boer3-Dec-18 17:43 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
ForNow4-Dec-18 1:44
ForNow4-Dec-18 1:44 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
leon de boer4-Dec-18 7:41
leon de boer4-Dec-18 7:41 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
Victor Nijegorodov4-Dec-18 8:27
Victor Nijegorodov4-Dec-18 8:27 
AnswerRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
Victor Nijegorodov3-Dec-18 20:27
Victor Nijegorodov3-Dec-18 20:27 
GeneralRe: CComobox::DrawItem list box entries Disappears In Release Mode Pin
ForNow4-Dec-18 1:46
ForNow4-Dec-18 1: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.