书上的范例,但VC6.0运行出错,新手请教
//carrots.cpp -- food processing program
//uses and displays a variable
#include <iostream>
int main()
{
using namespace std; //declare an integer variable
int carrots;
carrots = 25;
cout<<"I have";
cout<<carrots;
cout<<"carrots.";
cout<<endl;
carrost = carrots - 1;
cout<<"Crunch, crunch. Now I have"<<carrots<<"carrots."<<endl;
return 0;
}
运行在VC++6.0,提示carrots是没申报的表示符,但我是一字不差的抄书上的,怎么会出错,我新手,有点纳闷,各位大虾帮忙,谢谢