aşağıdaki kodda hata alıyorum int bir diziyi dosyaya yazdırmaya çalışıp dosya içine baktığımda int değerlerin rasgele olduğunu görüyorum bi bakabilirmisiniz?
typedef struct {
char ad[20];
char soyad[20];
double TCKN[11];
}alan;
void rehber_txt_olustur()
{
int i ;
alan x[3];
rehber_txt = fopen("rehber.txt","w");
if( rehber_txt == NULL)
{
cout << "dosya acilamadi :" << endl;
exit(1);
}
for(i = 0; i < 3; i++)
{
cout << "TCKN giriniz: " << endl;
scanf("%d",&x.TCKN);
cout << "ad giriniz:" << endl;
scanf("%s",&x.ad);
cout << "soyad giriniz :" << endl;
scanf("%s",&x.soyad);
fprintf(rehber_txt,"%d %s %s \n",x.TCKN, x.ad, x.soyad);
}
fclose(rehber_txt);
}
int main()
{
rehber_txt_olustur();
}