added string test and it works

This commit is contained in:
Samuel D. Crow
2021-03-29 14:23:50 -05:00
parent b0072dffa4
commit 0fe8d74bc5
2 changed files with 17 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ void printSegment::generate()
switch (op->getSimpleVarType())
{
case T_STRINGVAR:
output_cpp << "puts(" << op->boxName() << ");\n";
output_cpp << "puts(" << op->boxName() << ".c_str());\n";
break;
case T_INTVAR:
output_cpp << "printf(\"%d\", " << op->boxName() << ");\n";