Since variable names are just compile type names for human interaction with source code you can't directly do it.
The easiest way would be to use a map (which is basically an associative array, no actually it isn't but from what you need to know for your problem it is) to obtain what you need:
#include <map>
std::map<string, Line> lines;
Line line = Line(A,B,C)
string name = "lineName";
lines[name] = line;
...
std::map<string,Line>::iterator it = lines.find(name);
if (it != lines.end())
{
const Line& line = it->second;
..
}