I am a beginner. Whats wrong with my code?

I am a beginner. I am trying to make a code that will have a object. It will take a character as input ans show it on the screen. I am trying to code it. But, I don't find where is the culprit. Please help me.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

using namespace std;

//Decaring class samp
class samp
{
	char ch;

public:
	void set_ch(char c) { ch = c; }
	char get_ch() { return ch; }
};


int main()
{
	samp s1;

	s1.set_ch(a);

	return 0;
}
s1.set_ch('a');
thanks a lot. Its working
Topic archived. No new replies allowed.