From what I see, you would like to do something like:
1 2 3 4 5 6 7 8 9
if( square == "a1")
{
std::cout<<a1;
}
elseif( square == "a2")
{
std::cout<<a2;
}
//... and so on
Well, then there's this way. If you need to do it for some more sophisticated reasons and it's just an example, or you simply have a huge data, then check maps: http://www.cplusplus.com/reference/map/map/
There is no way to convert a string containing an identifier name to some kind of actual reference to the variable itself because C++ is not reflective. At runtime all the names you have given variables no longer exist, in essence.
@Zhuge - That is true. What I am trying to do is find a code that would let the compiler points to the var in whatever type of referencing it would do at runtime.