Click here to Skip to main content
15,914,225 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSendMessage Pin
Alan Blakely19-Jan-02 14:55
Alan Blakely19-Jan-02 14:55 
GeneralRe: SendMessage Pin
Christopher Lord20-Jan-02 11:44
Christopher Lord20-Jan-02 11:44 
GeneralRe: SendMessage Pin
Roger Allen21-Jan-02 2:36
Roger Allen21-Jan-02 2:36 
GeneralVC.Net resource file always rebuilds Pin
Tim Smith19-Jan-02 13:17
Tim Smith19-Jan-02 13:17 
GeneralRe: VC.Net resource file always rebuilds Pin
Christian Graus19-Jan-02 13:59
protectorChristian Graus19-Jan-02 13:59 
GeneralRe: VC.Net resource file always rebuilds Pin
Tim Smith19-Jan-02 14:15
Tim Smith19-Jan-02 14:15 
GeneralArrays Pin
Alan Blakely19-Jan-02 11:32
Alan Blakely19-Jan-02 11:32 
GeneralRe: Arrays Pin
Christian Graus19-Jan-02 12:47
protectorChristian Graus19-Jan-02 12:47 
ifstream str(_T("Myfile.txt"));
if (!str.is_open())
{
AfxMessageBox(_T("Could not open file"));
return FALSE;
}

vector<string> file_contents;
copy(istream_iterator<string>(str), istream_iterator<string>(), back_inserter(file_contents));

This assumes you've done the approproate includes (fstream, vector, algorithm, string I believe ) and the appropriate using std:: commands ( ifstream, vector, back_iterator, string and copy ).

I've just tested this ( and found my typo, sorry ), and it works, but it builds a list of words, not sentences. I dunno off the top of my head how to get a stream to not take a space as a delimiter.

Christian

I have come to clean zee pooollll. - Michael Martin Dec 30, 2001

<Center><A href = "http://www.sonork.com" target = "_Blank">Sonork</A> ID 100.10002:MeanManOz</Center><Center>I live in <U><B>Bob's HungOut</B></U> now</center>
GeneralRe: Arrays Pin
Alan Blakely19-Jan-02 13:24
Alan Blakely19-Jan-02 13:24 
GeneralRe: Arrays Pin
Christian Graus19-Jan-02 22:56
protectorChristian Graus19-Jan-02 22:56 
GeneralRedimensioning Arrays Pin
DiegoValdevino19-Jan-02 11:16
DiegoValdevino19-Jan-02 11:16 
GeneralRe: Redimensioning Arrays Pin
Christian Graus19-Jan-02 11:25
protectorChristian Graus19-Jan-02 11:25 
GeneralRe: Redimensioning Arrays Pin
Prem Kumar19-Jan-02 11:30
Prem Kumar19-Jan-02 11:30 
GeneralRe: Redimensioning Arrays Pin
Christian Graus19-Jan-02 12:37
protectorChristian Graus19-Jan-02 12:37 
GeneralRe: Redimensioning Arrays Pin
l a u r e n19-Jan-02 23:05
l a u r e n19-Jan-02 23:05 
GeneralRe: Redimensioning Arrays Pin
Christian Graus19-Jan-02 23:31
protectorChristian Graus19-Jan-02 23:31 
GeneralToolbar graphic Pin
Jon Newman19-Jan-02 9:32
Jon Newman19-Jan-02 9:32 
GeneralMaintaining VC 5.0 and VC 6.0 Pin
Phil F19-Jan-02 9:14
Phil F19-Jan-02 9:14 
GeneralRe: Maintaining VC 5.0 and VC 6.0 Pin
Rick Crone24-Jan-02 10:21
Rick Crone24-Jan-02 10:21 
GeneralCD-RW questions...help needed Pin
Amit Dey19-Jan-02 8:17
Amit Dey19-Jan-02 8:17 
Questioncreating instance of class in other class? Pin
19-Jan-02 8:03
suss19-Jan-02 8:03 
AnswerRe: creating instance of class in other class? Pin
Christian Graus19-Jan-02 11:14
protectorChristian Graus19-Jan-02 11:14 
GeneralNeed help.. some MFC function Pin
19-Jan-02 7:12
suss19-Jan-02 7:12 
GeneralRe: Need help.. some MFC function Pin
User 665819-Jan-02 7:32
User 665819-Jan-02 7:32 
GeneralRe: Need help.. some MFC function Pin
20-Jan-02 17:21
suss20-Jan-02 17:21 

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.