Hey everybody, I need a bit of a hand with declaring a string array in my class header file in C++.
atm it looks like this:
//Maze.h
#include <string>
class Maze
{
GLfloat mazeSize, mazeX, mazeY, mazeZ;
string* mazeLayout;
public:
Maze ( );
void render();
};
and the constructor looks like this:
//Maze.cpp
#include <GL/gl.h>
#include "Maze.h"
#include <iostream>
#include <fstream>
Maze::Maze( )
{
cin >> mazeSize;
mazeLayout = new string[mazeSize];
mazeX = 2/mazeSize;
mazeY = 0.25;
mazeZ = 2/mazeSize;
}
I'm getting a compiler error that says:
In file included from model-view.cpp:11:
Maze.h:14: error: ISO C++ forbids declaration of ‘string’ with no type
Maze.h:14: error: expected ‘;’ before ‘*’ token
and the only sense that makes to me is that for some reason it thinks I want string as a variable name not as a type declaration.
If anybody could help me out that would be fantastic, been looking this up for a while and its giving me the shits lol.
Cheers guys