def get_c_var(declaration: str, code: list[str]) -> str:
    """Given a C Variable declaration and a list of (lines of) code, format it into something C will be happy with"""

    # this will contain the final payload
    payload: str = ""

    # add the declaration and open the braces
    payload += f"{declaration} = {{\n"

    # for each line of code...
    for idx, line in enumerate(code):

        # if its the last line, dont add a comma
        if idx == len(code) - 1:
            end = "\n"
        else:
            end = ",\n"

        # escape any "
        if '"' in line:
            line = line.replace('"', '\\"')

        # add it
        payload += f'    "{line}"{end}'

    # close stuff
    payload += "};"

    return payload