代碼如下 並不會有任何東西寫出來
i=0;
counts=0;
FILE *ofile;
errno_t oerr;
oerr = fopen_s(&ofile,"E:\\workspace\\TVPLAY\\data\\test\\test2.txt","w");
if(oerr!=0)
{
cout<<"could not open the file";
exit(EXIT_FAILURE);
}
for (int i = 0; i < sizeof(data); i++)
{
if(fprintf_s(ofile,"%d",(int *)&data[i])<0)
{
break;
}
i++;
counts++;
}
基礎不牢,用什麼都可能成漏洞的啊。data 什麼定義啊