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

C / C++ / MFC

 
AnswerRe: type convertion - ulong to uint Pin
Stephen Hewitt4-Mar-06 19:47
Stephen Hewitt4-Mar-06 19:47 
GeneralRe: type convertion - ulong to uint Pin
Tim Smith5-Mar-06 8:55
Tim Smith5-Mar-06 8:55 
GeneralRe: type convertion - ulong to uint Pin
Stephen Hewitt5-Mar-06 11:25
Stephen Hewitt5-Mar-06 11:25 
GeneralRe: type convertion - ulong to uint Pin
John R. Shaw5-Mar-06 15:42
John R. Shaw5-Mar-06 15:42 
Questionstd c++ i/o with files Pin
Peter Charlesworth4-Mar-06 8:15
Peter Charlesworth4-Mar-06 8:15 
AnswerRe: std c++ i/o with files Pin
PJ Arends4-Mar-06 11:40
professionalPJ Arends4-Mar-06 11:40 
GeneralRe: std c++ i/o with files Pin
Peter Charlesworth4-Mar-06 11:50
Peter Charlesworth4-Mar-06 11:50 
GeneralRe: std c++ i/o with files Pin
John R. Shaw4-Mar-06 15:22
John R. Shaw4-Mar-06 15:22 
You already mentioned the method "getline", it reads one whole line at a time. You just need to count the number of lines you read.

The other part of finding a substring (part of the line), you just do on a line by line bases. Unless there is a newline in the substring, in which case you have to search the whole file piece by piece or a character at at time, your choice.

You could just load the whole file (if not to larg) into an STL string type and call find to search for a substring.

The is a ridiculously large number of ways to do what you want, just look at what your library offers (string and file i/o), and your imagination.

You can even use regular expressions.


INTP
Every thing is relative...
AnswerKerridge Pin
Rob Caldecott5-Mar-06 6:35
Rob Caldecott5-Mar-06 6:35 
GeneralRe: Kerridge Pin
Peter Charlesworth5-Mar-06 7:37
Peter Charlesworth5-Mar-06 7:37 
Questioncreateprocess Pin
Sam 20064-Mar-06 6:58
Sam 20064-Mar-06 6:58 
AnswerRe: createprocess Pin
PJ Arends4-Mar-06 11:52
professionalPJ Arends4-Mar-06 11:52 
QuestionDeploying a VC++ application on a target machine Pin
Themis4-Mar-06 6:53
Themis4-Mar-06 6:53 
AnswerRe: Deploying a VC++ application on a target machine Pin
Richard_484-Mar-06 12:50
Richard_484-Mar-06 12:50 
GeneralRe: Deploying a VC++ application on a target machine Pin
Themis4-Mar-06 21:27
Themis4-Mar-06 21:27 
GeneralRe: Deploying a VC++ application on a target machine Pin
Gary R. Wheeler5-Mar-06 3:07
Gary R. Wheeler5-Mar-06 3:07 
AnswerRe: Deploying a VC++ application on a target machine Pin
Michael Dunn5-Mar-06 6:34
sitebuilderMichael Dunn5-Mar-06 6:34 
QuestionText Justification Pin
Richard_484-Mar-06 5:50
Richard_484-Mar-06 5:50 
QuestionRe Post of earlier message - ANSI String in Classes Pin
Tom Moore4-Mar-06 4:45
Tom Moore4-Mar-06 4:45 
AnswerRe: Re Post of earlier message - ANSI String in Classes Pin
Nemanja Trifunovic4-Mar-06 4:47
Nemanja Trifunovic4-Mar-06 4:47 
GeneralRe: Re Post of earlier message - ANSI String in Classes Pin
Tom Moore4-Mar-06 5:01
Tom Moore4-Mar-06 5:01 
GeneralRe: Re Post of earlier message - ANSI String in Classes Pin
Nemanja Trifunovic4-Mar-06 5:20
Nemanja Trifunovic4-Mar-06 5:20 
QuestionStack Overflow, possible cause? Pin
Waldermort4-Mar-06 4:16
Waldermort4-Mar-06 4:16 
AnswerRe: Stack Overflow, possible cause? Pin
Christian Graus4-Mar-06 5:13
protectorChristian Graus4-Mar-06 5:13 
GeneralRe: Stack Overflow, possible cause? Pin
Waldermort4-Mar-06 5:33
Waldermort4-Mar-06 5:33 

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.