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

C / C++ / MFC

 
QuestionAnsiString searching? Pin
Steven Richardson24-Feb-02 9:05
Steven Richardson24-Feb-02 9:05 
AnswerRe: AnsiString searching? Pin
Orbital^25-Feb-02 3:29
Orbital^25-Feb-02 3:29 
GeneralToken and parsing Pin
HomeNuke24-Feb-02 8:47
HomeNuke24-Feb-02 8:47 
GeneralRe: Token and parsing Pin
Orbital^25-Feb-02 3:27
Orbital^25-Feb-02 3:27 
GeneralRe: Token and parsing Pin
HomeNuke25-Feb-02 9:24
HomeNuke25-Feb-02 9:24 
GeneralRe: Token and parsing Pin
HomeNuke25-Feb-02 11:47
HomeNuke25-Feb-02 11:47 
Generalshell extension implementing IShellFolder : XP problem Pin
24-Feb-02 7:36
suss24-Feb-02 7:36 
GeneralRemovespaces() Pin
24-Feb-02 7:14
suss24-Feb-02 7:14 
Hello!

When you read my question I'm sure you understand that I'm very new with C++.
But i give it a try.

I'm working with some school-assignments and have a problem with removeSpaces.
I have a string which contains "Hello mate", and from my main function I want to call the function removeSpaces. Can anyone who is better than me tell me how to write in this function to get rid of these spaces, and at the same time count the spaces we got rid of?

I have some code here, if it helps?

void main(void)
{
String S;
S.setText("Hello mate" ");
S.removeSpaces();
S.display();
cout << S.length() << endl;

}

int String::removeSpaces()
{

return ?;
}

Kind regards The Swede
GeneralRe: Removespaces() Pin
Mazdak24-Feb-02 7:25
Mazdak24-Feb-02 7:25 
GeneralFile Database & Data Structure :: C++ Pin
valikac24-Feb-02 6:46
valikac24-Feb-02 6:46 
GeneralRe: File Database & Data Structure :: C++ Pin
Paul M Watt24-Feb-02 15:16
mentorPaul M Watt24-Feb-02 15:16 
GeneralRe: File Database & Data Structure :: C++ Pin
valikac24-Feb-02 15:50
valikac24-Feb-02 15:50 
GeneralSearch a string in another string Pin
24-Feb-02 6:44
suss24-Feb-02 6:44 
GeneralRe: strstr, wcsstr Pin
24-Feb-02 7:06
suss24-Feb-02 7:06 
GeneralRe: Search a string in another string Pin
24-Feb-02 12:41
suss24-Feb-02 12:41 
GeneralAAAAAAAAAAAAAAAARGH! Pin
Georg Haan24-Feb-02 5:52
Georg Haan24-Feb-02 5:52 
Generalsrand() Pin
Mazdak24-Feb-02 5:47
Mazdak24-Feb-02 5:47 
GeneralRe: srand() Pin
Georg Haan24-Feb-02 6:18
Georg Haan24-Feb-02 6:18 
GeneralRe: srand() Pin
Mazdak24-Feb-02 7:16
Mazdak24-Feb-02 7:16 
GeneralRe: srand() Pin
Tim Smith24-Feb-02 7:31
Tim Smith24-Feb-02 7:31 
GeneralRe: srand() Pin
Anders Molin24-Feb-02 11:04
professionalAnders Molin24-Feb-02 11:04 
GeneralRe: srand() Pin
Paul M Watt24-Feb-02 15:03
mentorPaul M Watt24-Feb-02 15:03 
QuestionAnsiString to string w/o changing what is in it? Pin
Steven Richardson24-Feb-02 5:40
Steven Richardson24-Feb-02 5:40 
AnswerRe: AnsiString to string w/o changing what is in it? Pin
Paul M Watt24-Feb-02 15:02
mentorPaul M Watt24-Feb-02 15:02 
GeneralRe: AnsiString to string w/o changing what is in it? Pin
Steven Richardson25-Feb-02 1:33
Steven Richardson25-Feb-02 1: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.