Click here to Skip to main content
16,017,100 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Assertion Failed Pin
Mark Salsbery26-Mar-07 8:26
Mark Salsbery26-Mar-07 8:26 
GeneralRe: Assertion Failed Pin
Stephen Hewitt25-Mar-07 14:18
Stephen Hewitt25-Mar-07 14:18 
QuestionRe: Assertion Failed Pin
David Crow26-Mar-07 2:36
David Crow26-Mar-07 2:36 
AnswerRe: Assertion Failed Pin
crieagu26-Mar-07 3:09
crieagu26-Mar-07 3:09 
GeneralRe: Assertion Failed Pin
David Crow26-Mar-07 3:20
David Crow26-Mar-07 3:20 
GeneralRe: Assertion Failed Pin
crieagu26-Mar-07 3:37
crieagu26-Mar-07 3:37 
GeneralRe: Assertion Failed Pin
David Crow26-Mar-07 3:39
David Crow26-Mar-07 3:39 
QuestionReading csv file -> Lil modification needed..... Pin
Software_Specialist24-Mar-07 15:13
Software_Specialist24-Mar-07 15:13 
Hi all
The below code is reading string and then tokenizin it and reading all the info. But i want to call a csv file and it should then read a string from dt file. So what midification should i do in the below code. Its main code, all the functions are defined well. So just wanna know how to include some extra code to open the file and read each line.
Thanks a lot
typedef struct
{
string firstName;
string surname;
unsigned int HouseNumber;
string StreetName;
string Town;
unsigned int PostCode;
string email;
unsigned int Phone;
}Person;

int main(int argc, char* argv[])
{


string data = "James,Bond,33,AlberStreet,Manchester,HG231,abc@yahoo.com,2552423";
string delimiter = ",";
StringTokenizer strtok(data,delimiter);
StringTokenizer strtok(data,delimiter);

if(strtok.countTokens() != 8)
{
cout << "!-Error-! Not enough tokens!" << std::endl;
}
else
{
Person person;
person.firstName = strtok.nextToken();
person.surname = strtok.nextToken();
person.HouseNumber = strtok.nextIntToken();
person.StreetName = strtok.nextToken();
person.Town = strtok.nextToken();
person.PostCode = strtok.nextIntToken();
person.email = strtok.nextToken();
person.Phone = strtok.nextIntToken();
}


}
AnswerRe: Reading csv file -> Lil modification needed..... Pin
Software_Specialist25-Mar-07 3:30
Software_Specialist25-Mar-07 3:30 
GeneralRe: Reading csv file -> Lil modification needed..... Pin
PJ Arends25-Mar-07 13:20
professionalPJ Arends25-Mar-07 13:20 
GeneralRe: Reading csv file -&amp;gt; Lil modification needed..... Pin
Stephen Hewitt25-Mar-07 14:32
Stephen Hewitt25-Mar-07 14:32 
GeneralRe: Reading csv file -> Lil modification needed..... Pin
PJ Arends25-Mar-07 17:00
professionalPJ Arends25-Mar-07 17:00 
AnswerRe: Reading csv file -> Lil modification needed..... Pin
Stephen Hewitt25-Mar-07 14:35
Stephen Hewitt25-Mar-07 14:35 
GeneralRe: Reading csv file -> Lil modification needed..... Pin
Software_Specialist26-Mar-07 10:21
Software_Specialist26-Mar-07 10:21 
GeneralRe: Reading csv file -&amp;gt; Lil modification needed..... Pin
Stephen Hewitt26-Mar-07 13:22
Stephen Hewitt26-Mar-07 13:22 
GeneralRe: Reading csv file -&amp;gt; Lil modification needed..... Pin
Software_Specialist26-Mar-07 14:22
Software_Specialist26-Mar-07 14:22 
GeneralRe: Reading csv file -&amp;gt; Lil modification needed..... Pin
Stephen Hewitt26-Mar-07 14:32
Stephen Hewitt26-Mar-07 14:32 
GeneralRe: Reading csv file -&amp;gt; Lil modification needed..... Pin
Software_Specialist27-Mar-07 2:34
Software_Specialist27-Mar-07 2:34 
GeneralRe: Reading csv file -&amp;amp;gt; Lil modification needed..... Pin
Stephen Hewitt27-Mar-07 4:01
Stephen Hewitt27-Mar-07 4:01 
QuestionPPC (tmpstr) Index Numbering Pin
ZapMe124-Mar-07 11:30
ZapMe124-Mar-07 11:30 
QuestionActive interfaces [modified] Pin
deeps_cute24-Mar-07 9:38
deeps_cute24-Mar-07 9:38 
QuestionRe: Active interfaces Pin
Mark Salsbery25-Mar-07 9:02
Mark Salsbery25-Mar-07 9:02 
Questionhow many lines? Pin
Lord_Vader24-Mar-07 9:19
Lord_Vader24-Mar-07 9:19 
AnswerRe: how many lines? Pin
Christian Graus24-Mar-07 10:02
protectorChristian Graus24-Mar-07 10:02 
GeneralRe: how many lines? Pin
Lord_Vader24-Mar-07 10:06
Lord_Vader24-Mar-07 10:06 

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.