Hi there guys,
I'm trying to add a word count to an application i have made. The application is just a simple notepad. A feature im trying to add is a word count.
The text i want to count is stored in a memo box called 'Memo'.
Here is the logical way i think the code should work, can anyone help me turn this into C++.
Somehow i have to turn the Memo->Lines into an array of charcters where the first character will = c[i] and the last will equal c[i+length]. Is their a command for doing this?
Hopefully if i can figure this out i should be able to do the rest...
Appreciation in advance
P.s. I'm only just starting out with C++ so please take that into consideration
I'm trying to add a word count to an application i have made. The application is just a simple notepad. A feature im trying to add is a word count.
The text i want to count is stored in a memo box called 'Memo'.
Here is the logical way i think the code should work, can anyone help me turn this into C++.
Code:
char *c = Memo->Lines.c_str(); count = 0; For (i=0;i=MemoLengthInCharacters;i++) { If(c[i]=" " && c[i+1]!=" ") { count++; } }
Hopefully if i can figure this out i should be able to do the rest...
Appreciation in advance
P.s. I'm only just starting out with C++ so please take that into consideration

Comment