Well if you're going to continue to use the C API in a C++ program (I don't recommend it), then it would be

fprintf(newfile,"1" " %s" " %s", str1[6].c_str(), str2[6].c_str() );