• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

C dili struct serileştirme

Üyelik Tarihi
7 Ocak 2015
Konular
4,091
Mesajlar
4,274
MFC Puanı
40
Kod:
#include <stdio.h>
#include <string.h>
struct yapi{
    int a;
}x;
int main(****){
    FILE *dosya=fopen("c:/deneme.txt","a+");
    x.a=123;
    fwrite(&x,sizeof(struct yapi),1,dosya);
    x.a=33;
    printf("%d\n",x.a);                        /*bu program struct'ı serileştirir.*/
    fseek(dosya,SEEK_SET,0);
    fread(&x,sizeof(struct yapi),1,dosya);
    printf("%d\n",x.a);
    getchar();
}
 
Üst