import struct


def get_array_of_string(num, length, data):
    """Read subset of data as an array of strings

    Parameters
    ----------
    num : int
        Number of entries in the array
    length : int
        Length of the strings in the array
    data : str
        4C binary file

    Returns
    -------
    str
        Truncated 4C binary data file
    list
        List of strings from data file

    """
    results = []
    pos = 0
    for i in range(num):
        val = struct.unpack('{}s'.format(length),
                            data[pos:pos + length])[0].decode()
        results.append(val.strip())
        pos += length
    new_data = data[pos:]
    return new_data, results