I am trying to to get this program to find spaces in a
string of characters and display the count.
I am not sure of my codes and the error that I got seems
a little strange. Can anyone look at my codes and give me
My os is VC++ ver. 6.0, I have a desktop using win 2k.
My codes and the returned errors.
using namespace std;
// not used --->char locate_blank(char *);
char line = "This is a string test. It contains two sentence.";
cout << "The original sentence is : " << line;
for (count = 0; line[count]= '\0'; count++)
if (line[count] == ' ')
line[count+1] = ' ';
cout << "This sentence contains" << count(line) << "blanks";
/* Error list
------Configuration: findBlanks#2 - Win32 Debug-------
C:\Documents\Desktop\findBlanks#2.cpp(23) : error C2064: term does not evaluate to a function
Error executing cl.exe.
findBlanks#2.obj - 1 error(s), 0 warning(s)