Hi,
Can someone help me in a borland c++ code?
i already have a memo field and i want to count the words, i count the blanks but i have problem when appears 2 or more blanks together and when i write to the second line..
Also can anybody tell me how to print the memo index as a text?
thanks
dav83
0
Newbie Poster
Recommended Answers
Jump to Postsounds like you are on the right track.. counting the number of spaces is probably the easiest way to calculate the number of words in a file.. but as you have already identified.. one could run into trouble if there are multiple spaces in between words..
so why not …
Jump to PostHaven't seen any of your code.. but here is my guess:
int i=0, word_count=0; //If no text head been read, exit the function if(!myText.size()) return; //Test to see if there are any non-white spaces bool flag=FALSE; while(!Flag && myText.substring(i, 1)) { if(!isspace(myText.substring)) flag=TRUE; i++; } if(flag==FALSE) { …
All 6 Replies
Clinton Portis
211
Practically a Posting Shark
dav83
0
Newbie Poster
Clinton Portis
211
Practically a Posting Shark
dav83
0
Newbie Poster
Clinton Portis
211
Practically a Posting Shark
dav83
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.