Click here to Skip to main content
15,922,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Scroll Window without document/view Pin
includeh1022-Apr-06 4:08
includeh1022-Apr-06 4:08 
QuestionListbox control Pin
srija22-Apr-06 1:26
srija22-Apr-06 1:26 
AnswerRe: Listbox control Pin
Gary R. Wheeler22-Apr-06 2:11
Gary R. Wheeler22-Apr-06 2:11 
GeneralRe: Listbox control Pin
srija22-Apr-06 5:18
srija22-Apr-06 5:18 
GeneralRe: Listbox control Pin
Bram van Kampen22-Apr-06 15:49
Bram van Kampen22-Apr-06 15:49 
GeneralRe: Listbox control Pin
srija23-Apr-06 7:02
srija23-Apr-06 7:02 
Questionreading strings from file - newbie Pin
antonaras_marcou22-Apr-06 1:23
antonaras_marcou22-Apr-06 1:23 
AnswerRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 1:46
Stephen Hewitt22-Apr-06 1:46 
Don't use all this old fashioned fopen and fgets - This is C++ not C!
Here's how I'd do it. I haven't tested this, it's off the cuff; so you may need to add a semicolon or some such:
void TokenCheck(const string &token)
{
    ifstream fs("dictionary.txt");
    if ( fs )
    {
       istream_iterator<string> i(fs);
       istream_iterator<string> e;
       if ( find(i, e, token)!=e )
       {
             // Found.
       }
    }
}</code>


Uses the following includes:
 <string>
 <fstream>
 <iterator>
 <algorithm>

Assumes:
 using namespace std;


Steve
GeneralRe: reading strings from file - newbie Pin
antonaras_marcou22-Apr-06 2:07
antonaras_marcou22-Apr-06 2:07 
GeneralRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 2:10
Stephen Hewitt22-Apr-06 2:10 
AnswerRe: reading strings from file - newbie Pin
Michael Dunn22-Apr-06 9:12
sitebuilderMichael Dunn22-Apr-06 9:12 
GeneralRe: reading strings from file - newbie Pin
Stephen Hewitt22-Apr-06 18:51
Stephen Hewitt22-Apr-06 18:51 
QuestionPlacing transparent bitmaps into dialogs Pin
Rafael Fernández López22-Apr-06 1:04
Rafael Fernández López22-Apr-06 1:04 
AnswerRe: Placing transparent bitmaps into dialogs Pin
John R. Shaw22-Apr-06 18:37
John R. Shaw22-Apr-06 18:37 
QuestionProperty Sheet Problem Pin
si_6921-Apr-06 23:42
si_6921-Apr-06 23:42 
AnswerRe: Property Sheet Problem Pin
includeh1022-Apr-06 4:40
includeh1022-Apr-06 4:40 
GeneralRe: Property Sheet Problem Pin
si_6922-Apr-06 11:58
si_6922-Apr-06 11:58 
Questionhow can i get my app path? Pin
Sina Parastgary21-Apr-06 23:29
Sina Parastgary21-Apr-06 23:29 
AnswerRe: how can i get my app path? Pin
Naveen21-Apr-06 23:40
Naveen21-Apr-06 23:40 
AnswerRe: how can i get my app path? Pin
Michael Dunn22-Apr-06 9:14
sitebuilderMichael Dunn22-Apr-06 9:14 
QuestionUsing OLE IStream in a thread Pin
Waldermort21-Apr-06 23:27
Waldermort21-Apr-06 23:27 
AnswerRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 0:32
Stephen Hewitt22-Apr-06 0:32 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 0:46
Waldermort22-Apr-06 0:46 
GeneralRe: Using OLE IStream in a thread Pin
Stephen Hewitt22-Apr-06 1:08
Stephen Hewitt22-Apr-06 1:08 
GeneralRe: Using OLE IStream in a thread Pin
Waldermort22-Apr-06 1:58
Waldermort22-Apr-06 1:58 

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.