Click here to Skip to main content
16,005,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAssertion error in DoModal() Pin
Anu_Bala6-Jul-06 0:48
Anu_Bala6-Jul-06 0:48 
AnswerRe: Assertion error in DoModal() Pin
KarstenK6-Jul-06 1:06
mveKarstenK6-Jul-06 1:06 
QuestionRe: Assertion error in DoModal() Pin
David Crow6-Jul-06 3:29
David Crow6-Jul-06 3:29 
Questionstoring strings Pin
Desmo166-Jul-06 0:29
Desmo166-Jul-06 0:29 
AnswerRe: storing strings Pin
Justin Tay6-Jul-06 1:07
Justin Tay6-Jul-06 1:07 
AnswerRe: storing strings Pin
Sarath C6-Jul-06 1:08
Sarath C6-Jul-06 1:08 
AnswerRe: storing strings Pin
KarstenK6-Jul-06 1:10
mveKarstenK6-Jul-06 1:10 
AnswerRe: storing strings Pin
Stephen Hewitt6-Jul-06 1:37
Stephen Hewitt6-Jul-06 1:37 
Try something like this (not tested):
-------------------------------------

#include <fstream>
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <iterator>

int main(int argc, char *argv[])
{
using namespace std;

// Open the file.
ifstream ifs("C:\\a.txt");
if (!ifs)
{
return 1;
}

// A collection of strings.
typedef vector<string> strings_t;
strings_t StringColl;

// Read in the file line at a time.
string line;
while (getline(ifs, line))
{
// Get the first string in the line.
string FirstString;
istringstream iss(line);
if ( !(iss>>FirstString) )
{
break;
}

// Add it to the collection.
StringColl.push_back(FirstString);
}

// Output the strings in the collection to the console.
copy(StringColl.begin(), StringColl.end(), ostream_iterator<string>(cout, "\n"));

return 0;
}

Steve
AnswerRe: storing strings Pin
ThatsAlok6-Jul-06 19:33
ThatsAlok6-Jul-06 19:33 
GeneralRe: storing strings Pin
Stephen Hewitt7-Jul-06 0:13
Stephen Hewitt7-Jul-06 0:13 
GeneralRe: storing strings Pin
ThatsAlok7-Jul-06 0:30
ThatsAlok7-Jul-06 0:30 
GeneralRe: storing strings Pin
Stephen Hewitt7-Jul-06 3:37
Stephen Hewitt7-Jul-06 3:37 
Questiontwo views on single print preview in mfc Pin
RVShetty6-Jul-06 0:16
RVShetty6-Jul-06 0:16 
QuestionRemote Desktop Pin
Sarath C6-Jul-06 0:03
Sarath C6-Jul-06 0:03 
NewsRe: Remote Desktop Pin
KarstenK6-Jul-06 1:02
mveKarstenK6-Jul-06 1:02 
GeneralRe: Remote Desktop Pin
Sarath C6-Jul-06 1:04
Sarath C6-Jul-06 1:04 
QuestionSending keys Pin
Smith#6-Jul-06 0:02
Smith#6-Jul-06 0:02 
AnswerRe: Sending keys Pin
Justin Tay6-Jul-06 0:05
Justin Tay6-Jul-06 0:05 
GeneralRe: Sending keys Pin
Smith#6-Jul-06 0:17
Smith#6-Jul-06 0:17 
GeneralRe: Sending keys [modified] Pin
Justin Tay6-Jul-06 0:46
Justin Tay6-Jul-06 0:46 
GeneralRe: Sending keys Pin
ThatsAlok6-Jul-06 1:22
ThatsAlok6-Jul-06 1:22 
GeneralRe: Sending keys Pin
Smith#6-Jul-06 1:57
Smith#6-Jul-06 1:57 
GeneralRe: Sending keys Pin
ThatsAlok6-Jul-06 2:02
ThatsAlok6-Jul-06 2:02 
AnswerRe: Sending keys Pin
Muhammad Azam6-Jul-06 1:37
Muhammad Azam6-Jul-06 1:37 
GeneralRe: Sending keys Pin
Smith#6-Jul-06 1:58
Smith#6-Jul-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.