I'm so sorry for having to ask this question. I'm a beginner to C++, and as I'm following a tutorial, I tried to compile the cpp document. However doing so, I receive 1 error with 0 warnings.
Here is what I have written...
Code:
/*
An interactive program that computes
the area od a rectangle.
*/
#include <iostream>
using namespace std;
int main ()
{
int length; // this declares a variable
int width; // this declares another variable
cout<< "Enter the length: ";
cin>> length; // input the length
cout<< "Enter the width: ";
cin>> width; // input the width
cout<< "the area is ";
cout>> length * width; // display the area
return 0;
}
The error I get in the build window:
--------------------Configuration: sample2 - Win32 Debug--------------------
Compiling...
sample3.cpp
C:\Users\user\Documents\sample3.cpp(19) : error C2676: binary '>>' : 'class std::basic_ostream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the predefined operator
Error executing cl.exe.
sample3.obj - 1 error(s), 0 warning(s)
How do I know, or what do I look at to know where the error is.
Like I said, I'm a beginner and would appreciate any help.
Sorry if there has already been a thread on this before. I will try not to waste time and effort making a thread like this for the benefit of this website
Any help would be appreciated!