Hi, I picked up a book about simple game programming, so I was teaching my brother what little I know. When we tried to compile, we got this...
Mythiquest.cpp: In function ‘int main()’:
Mythiquest.cpp:25:1: error: expected initializer before ‘cout’
Mythiquest.cpp:32:8: error: ‘beasthunter’ was not declared in this scope
So... easy fix? I have looked and don't understand it. Here is his code...
//Doesnt Appear
//Made By Harry Rowan
#include<iostream> //Include File. Iostream is a file
#include<string>
usingnamespace std; //Namespace is like an area code for a phone number. Its a directory
int main() //This defines the main function of the program
{ //This opens the main program. Anything withing this is the main progaram
constint ARROWS = 7; //This is a CONST int which is a constant number. This cannot be changed
int gryffin = 2, unicorn = 1, goblin = 5, soul = 4; //Int is a (whole) number. It aplies a number to the type name
string beasthunter //String is a group of chars or simply a word
cout << "Welcome to my first C++ Game called Mythiquest\n" << endl; // These word are going to be outputted
cout << "The objective of the game is to kill all the creatures and save the world of threat!\n" << endl; //cout is an output
cout << "Gryffin are hard to beat, while goblins and souls are easier. When you meet a unicorn, it will heal you totally\n" << endl;
cout << "Please enter your name: " << endl; //
cin >> beasthunter >> endl; //Using cin to funnel out a word to beast_hunter
return 0;
}