How do you get this code working?

I have this bit of code:

char selection[2]
selection[0]=getche();
cout<<endl;
s = atoi(selection);
switch(s)
{
case 1:
baseconverter();
break;
case 2:
anycalc();
break;
}

When I run it, if you press 2 it would assume none of the statments matched and pass staight through the switch.

Can someone help?
Last edited on
Topic archived. No new replies allowed.