I'm making an rpg. When i enter the code(shown below) i get this error. What am i doing wrong?
main.cpp|15|error: invalid conversion from 'const char*' to 'char' [-fpermissive]|
#include <iostream>
#include <stdio.h>
#include <string>
#include <windows.h>
using namespace std;
int mainLoop()
{
char arr[4] = {'x', 'x', 'x', 'x'};
int pp = 1;
bool end = false;
string inp;
arr[pp] = "S";
while(end == false)
{
cout << arr << endl;
cout << ">>: " << endl;
cin >> inp;
if(inp == "move")
{
pp++;
}
}
}
int main()
{
mainLoop();
return 0;
}
EDIT:
Thanks! but now i have it leaving the old pp(player position) as S. I have tried making a new variable ppold and making it change pp-1 to x but nothing happens.