how to init this??

if(item=='a')
{
statements
}
this is worikig

how to input a code??
like

if(item=='AK012')
{
statements
}

i want to add a code
Use std::string http://www.cplusplus.com/reference/string/string/

1
2
3
4
5
6
7
8
std::string code ;
std::cout << "please enter code: " ;
std::cin >> code ; // type in AK012

if( code == "AK012" )
{
    // whatever
}
HI JLBorges.
thanks for quick reply
its works

thanks
Topic archived. No new replies allowed.