C++课本上的题目
// jump.cpp -- using continue and break#include <iostream>
const int ArSize = 80;
int main()
{
using namespace std;
char line[ArSize];
int space = 0;
cout << "Enter a line of text: \n";
cin.get (line,ArSize);
cout << "Complete line:\n" << line << endl;
cout << "Line through first period:\n";
for (int i = 0; line[i] !='\0'; i++)
{
cout << line[i];
if(line[i] == ".")
break;
if(line[i] !=' ')
space++;
}
cout << "\n" << space << " spaces\n";
cout << "Done.\n";
return 0;
}
error C2446: '==' : no conversion from 'char *' to 'int'
error C2040: '==' : 'int' differs in levels of indirection from 'char [2]'
Error executing cl.exe.
报错,麻烦大侠帮已修正