I am trying to write a program that will display text on a screen. However, everytime I try to compile the code I get these messages:
"'cout' : undeclared identifier"
"'std' : is not a class or namespace name"
If it helps, this is the code I was using:
// Army Tank RPG.cpp : Defines the entry point for the console application.
// This is supposed to be a game about a grandfather who leaves behind his Tank Building Business to his grandson.
#include "stdafx.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
std:: cout << "Welcome to ARMY TANK RPG!";
std:: cout << "This is a game about a grandson who leaves his tank building business to his grandson, which is you.";
std:: cout << "However, a gang of thiefs had been trying to pry the business from your grandfather for years.";
std:: cout << "It is up to you to help stop those bastards!";
return 0;
}
Can someone please give me more information about my errors?
NOTE: The program I'm currently building is just the information. Hopefully, when I get enough experience, I can actually make the program "Army Tank RPG."
// Army Tank RPG.cpp : Defines the entry point for the console application.
// This is supposed to be a game about a grandfather who leaves behind his Tank Building Business to his grandson.
#include <iostream>
usingnamespace std;
int main()
{
cout << "Welcome to ARMY TANK RPG!";
cout << "This is a game about a grandson who leaves his tank building business to his grandson, which is you.";
cout << "However, a gang of thiefs had been trying to pry the business from your grandfather for years.";
cout << "It is up to you to help stop those bastards!";
return 0;
}