Şimdi Ara

C İLE DOSYADAN OKUMA

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
1
Cevap
0
Favori
681
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • void textFile( FILE *readPtr )
    {
    FILE *writePtr;
    struct clientData client={0, " ", " ", 0.0 };

    if(( writePtr=fopen("account.txt", "w" ))==NULL ){
    printf("File could not be opened!!");
    }

    else
    {
    rewind(readPtr);
    fprintf(writePtr,"%-6s%-16s%-11s%10s\n","Acct","Last Name","Fist Name","Balance");

    while(!feof(readPtr)){
    fread(&client, sizeof(struct clientData),1,readPtr); /*******SORUN BURADA( SORUN "fscanf" KULLANILARAK ÇÖZÜLEBİLİYOR
    AMA NEDEN "fread" FONKSİYONUNU KULLANINCA SORUN YAŞIYORUM????)*******/

    if(client.acctNum!=0){
    fprintf(writePtr,"%-6d%-16s%-11s%10.2f\n", client.acctNum, client.lastName, client.firstName, client.balance);
    }
    } //end while
    fclose(writePtr);
    } //end else
    } //end function

    /*YARDIMLARINIZ İÇİN ŞİMDİDEN ÇOK TEŞEKKÜR EDERİM*/







  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.