You'll need to cast dwRead to be type size_t: `strBuf.insert((size_t)dwRead, 1, '\0')`