"Dungeon crawl" game question

Hello everyone.
I am wondering why do I get "error:invalid conversion from 'const char*' to 'char'" when I try to compile this code in Code Blocks?
Thanks in advance,



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;


int main()
{
	char x = "J";
	
	
	cout << x;

	return 0;
}
x is a single char, but "J" is a const char* (array). If you want a single character, use single quotes: char x = 'J';
Thanks mate :)
Topic archived. No new replies allowed.