我如何初始化类似python的列表并写入C ++中的文件

我在python中有此代码,我必须在c ++中进行翻译,但是我被困住了,因为我无法弄清楚如何无法在python中初始化像这样的列表以及如何在类似以下代码的文件中写入

def to_file(sy, ey, sx, ex, name, dor):
    rBloc = ["LINE\n", "8\n", str(dor) + "\n",
             "10\n" + str(sx) + "\n" + "11\n" + str(ex) + "\n" +
             "20\n" + str(sy) + "\n" + "21\n" + str(ey) + "\n" +
             "0\n"]
    with open(files.result_directory + r"\box_" + name[:-1] + ".dxf", "a") as f:
        for i in rBloc:
            f.write(str(i))