Click here to Skip to main content
15,919,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCode optimizations - script or compiled Pin
alex.barylski26-Jan-02 11:26
alex.barylski26-Jan-02 11:26 
GeneralRe: Code optimizations - script or compiled Pin
Rick York26-Jan-02 12:30
mveRick York26-Jan-02 12:30 
GeneralRe: Code optimizations - script or compiled Pin
alex.barylski26-Jan-02 13:01
alex.barylski26-Jan-02 13:01 
GeneralRe: Code optimizations - script or compiled Pin
markkuk27-Jan-02 19:56
markkuk27-Jan-02 19:56 
GeneralAccess violated Pin
Stephen Caldwell26-Jan-02 11:12
Stephen Caldwell26-Jan-02 11:12 
GeneralRe: Access violated Pin
Swinefeaster26-Jan-02 12:01
Swinefeaster26-Jan-02 12:01 
Generallocalhost Pin
Rickard Andersson2026-Jan-02 8:12
Rickard Andersson2026-Jan-02 8:12 
Generalcount words in file Pin
tbbooher26-Jan-02 8:04
tbbooher26-Jan-02 8:04 
I have talked with a lot of programmers about this (including one professor) and all know it's possible, but no one knows exactly how I can do this. I hope you do.

ifstream MyFile(FileName);
while (!MyFile.eof()) {
MyFile >> MyString;
cout << MyString << endl; }

This works great, but one problem is that the default >> operator seperates these words at spaces so I get from "What!! is, this;thing man?" :

What!!
is,
this;thing
man?

(4 words)

I want to separate at all punct char's (\":;?!, etc) so I get:

What
is
this
thing
man

(5 words)

Does anyone have an idea -- a lot of people in my lab are interested. We think that we can overload the << operator to do this, but need some guidance.

Thanks,

Tim
(oh how easy this is to do in Perl . . . )Confused | :confused:

---------------------------------------
Tim Booher
GeneralRe: count words in file Pin
Jon Sagara26-Jan-02 8:17
Jon Sagara26-Jan-02 8:17 
GeneralRe: count words in file Pin
tbbooher26-Jan-02 12:33
tbbooher26-Jan-02 12:33 
GeneralRe: count words in file Pin
pba_28-Jan-02 8:48
pba_28-Jan-02 8:48 
GeneralCRecordset question Pin
jafrazee26-Jan-02 7:23
jafrazee26-Jan-02 7:23 
Generaloverloaded methods in idl Pin
Brian Bailey26-Jan-02 6:59
Brian Bailey26-Jan-02 6:59 
GeneralWindows programming !!! How to learn Pin
26-Jan-02 6:25
suss26-Jan-02 6:25 
GeneralRe: Windows programming !!! How to learn Pin
alex.barylski26-Jan-02 11:33
alex.barylski26-Jan-02 11:33 
GeneralCString Format("...") problem in UNICODE Pin
26-Jan-02 1:20
suss26-Jan-02 1:20 
GeneralRe: CString Format("...") problem in UNICODE Pin
Tim Deveaux26-Jan-02 4:21
Tim Deveaux26-Jan-02 4:21 
GeneralResizing a control. Pin
NullStream26-Jan-02 0:55
NullStream26-Jan-02 0:55 
GeneralRe: Resizing a control. Pin
Christian Graus26-Jan-02 0:56
protectorChristian Graus26-Jan-02 0:56 
GeneralRe: Resizing a control. Pin
NullStream26-Jan-02 1:52
NullStream26-Jan-02 1:52 
GeneralRe: Resizing a control. Pin
Christian Graus26-Jan-02 9:37
protectorChristian Graus26-Jan-02 9:37 
GeneralRe: Resizing a control. Pin
Ravi Bhavnani26-Jan-02 10:17
professionalRavi Bhavnani26-Jan-02 10:17 
GeneralRe: Resizing a control. Pin
alex.barylski26-Jan-02 11:48
alex.barylski26-Jan-02 11:48 
GeneralMacro expansion porting from UNIX Pin
Martijn26-Jan-02 0:49
Martijn26-Jan-02 0:49 
GeneralRe: Macro expansion porting from UNIX Pin
Michael Dunn26-Jan-02 6:44
sitebuilderMichael Dunn26-Jan-02 6:44 

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.