I'm not really sure why "cout" and "endl" are not being recognized. Any help would be great!
The fact that iostream
has a red squiggle underneath it is a near certainty that you have something wrong with your environment (such as compiling with a C compiler rather than a C++ one, for example).
You need to fix that, since cout
and endl
are defined in that header. I'd start by hovering the mouse over the iostream
text and see what the tooltip shows you.
If it cannot find the file iostream
then you're either not using a C++ compiler, or your environment is severely damaged.
Either way, it's not a correct C++ environment.
Things to look in to are (to start with):
*.c
instead of *.cpp
may use a C compiler rather than a C++ one, for example).If you are sure you're using a C++ compiler:
iostream
string. You could totally delete that line and retype it (don't edit, it may not get rid of the funny character).cstdlib
) to see if it has the same problem.