Click here to Skip to main content
15,912,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can add Picture control Programmatically Pin
hemlat23-Feb-09 22:09
hemlat23-Feb-09 22:09 
QuestionDebug Assertion Failed Pin
MsmVc23-Feb-09 18:50
MsmVc23-Feb-09 18:50 
AnswerRe: Debug Assertion Failed Pin
«_Superman_»23-Feb-09 19:08
professional«_Superman_»23-Feb-09 19:08 
GeneralRe: Debug Assertion Failed Pin
MsmVc23-Feb-09 19:19
MsmVc23-Feb-09 19:19 
GeneralRe: Debug Assertion Failed Pin
CPallini23-Feb-09 20:40
mveCPallini23-Feb-09 20:40 
AnswerRe: Debug Assertion Failed Pin
KarstenK23-Feb-09 21:25
mveKarstenK23-Feb-09 21:25 
QuestionRe: Debug Assertion Failed Pin
David Crow24-Feb-09 3:28
David Crow24-Feb-09 3:28 
Questionusing vectors to parse text delimited files in C++ Pin
meixiang623-Feb-09 17:12
meixiang623-Feb-09 17:12 
I want to use vectors in C++ on a linux box to parse a tab delimited text file and parse something in the second column. In perl I could do something like this:

In perl:
#!/usr/local/bin/perl
while(<>)
{
chomp;
($first_col, $second_col, $third_col)=split(/\t/,$_);
if ($second_col =~ m/$target/g){
print "$second_col\n";
}
}


In C++ I have the following 2 D code, can someone modify it to parse out text in the column 2 using vectors? Thanks for everyones help in advance....



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

using namespace std;

int main()
{
ifstream ff( "test.txt", ios::in );
if ( !ff.is_open() )
return -1;

string name;
vector<string> names;

while( !ff.eof() )
{
ff &gt;&gt; name;

if (!ff.eof())
names.push_back( name );
}

copy (names.begin(), names.end(), ostream_iterator<string>(cout,"\n"));

return 0;
} </string></string></vector></string></fstream></iostream></iterator>
AnswerRe: using vectors to parse text delimited files in C++ Pin
Stuart Dootson23-Feb-09 19:56
professionalStuart Dootson23-Feb-09 19:56 
GeneralRe: using vectors to parse text delimited files in C++ Pin
meixiang624-Feb-09 5:03
meixiang624-Feb-09 5:03 
QuestionHelp with number to string conversion Pin
TabascoSauce23-Feb-09 14:09
TabascoSauce23-Feb-09 14:09 
AnswerRe: Help with number to string conversion Pin
Stuart Dootson23-Feb-09 14:26
professionalStuart Dootson23-Feb-09 14:26 
GeneralRe: Help with number to string conversion Pin
TabascoSauce23-Feb-09 15:32
TabascoSauce23-Feb-09 15:32 
QuestionNon-Static Member Call Question Pin
Rangarajan Varadan23-Feb-09 12:51
Rangarajan Varadan23-Feb-09 12:51 
AnswerRe: Non-Static Member Call Question Pin
Stuart Dootson23-Feb-09 13:53
professionalStuart Dootson23-Feb-09 13:53 
GeneralRe: Non-Static Member Call Question Pin
David Crow23-Feb-09 16:26
David Crow23-Feb-09 16:26 
GeneralRe: Non-Static Member Call Question Pin
Rangarajan Varadan25-Feb-09 10:40
Rangarajan Varadan25-Feb-09 10:40 
Questionread comma delimeted numbers and text mixture in a line [modified] Pin
mrby12323-Feb-09 12:08
mrby12323-Feb-09 12:08 
AnswerRe: read comma delimeted numbers and text mixture in a line Pin
Stuart Dootson23-Feb-09 12:40
professionalStuart Dootson23-Feb-09 12:40 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
mrby12323-Feb-09 12:47
mrby12323-Feb-09 12:47 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
Stuart Dootson23-Feb-09 13:48
professionalStuart Dootson23-Feb-09 13:48 
AnswerRe: read comma delimeted numbers and text mixture in a line Pin
David Crow23-Feb-09 16:29
David Crow23-Feb-09 16:29 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
mrby12323-Feb-09 16:47
mrby12323-Feb-09 16:47 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
David Crow24-Feb-09 2:40
David Crow24-Feb-09 2:40 
GeneralRe: read comma delimeted numbers and text mixture in a line Pin
mrby12323-Feb-09 19:05
mrby12323-Feb-09 19:05 

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.