So I decided to read a book and learn a little about C++, and every stupid example results in errors while compiling.
// carrots.cpp -- food processing program
// uses and displays a variable
// carrots.cpp -- food processing program
// uses and displays a variable
#include <iostream>
int main()
{
using namespace std;
int carrots; // declare an integer variable
carrots = 25; // assign a value to the variable
cout << “I have “; <--- error in this line
cout << carrots; // display the value of the variable
cout << “ carrots.”; <----error in this line
cout << endl;
carrots = carrots - 1; // modify the variable
cout << “Crunch, crunch. Now I have “ << carrots << “ carrots.” << endl; <---error...
return 0;
}
Not off the a good start here...
Tried using Microsoft and Bloodshed compilers.
// carrots.cpp -- food processing program
// uses and displays a variable
// carrots.cpp -- food processing program
// uses and displays a variable
#include <iostream>
int main()
{
using namespace std;
int carrots; // declare an integer variable
carrots = 25; // assign a value to the variable
cout << “I have “; <--- error in this line
cout << carrots; // display the value of the variable
cout << “ carrots.”; <----error in this line
cout << endl;
carrots = carrots - 1; // modify the variable
cout << “Crunch, crunch. Now I have “ << carrots << “ carrots.” << endl; <---error...
return 0;
}
Not off the a good start here...
Tried using Microsoft and Bloodshed compilers.
