#include <iostream>
#include <string.h>
using namespace std;
/* Variables */
int N = 0;
int M = 0;
int Px, Py;
int gcount = 0;
cin >> N >> M;
string maze[100];
/* Define Functions */
void read_maze(int);
void scan_maze(int);
void print_maze();
This is a code snippet for a text-based game I am making and when I run it, I get the following error:
main.cpp:10:1: error: 'cin' does not name a type
10 | cin >> N >> M;
| ^~~
I am not able to debug the problem with the code. Any ideas?
Editor: Atom
Operating System: Windows 10
Compiler: MinGW
Thanks