hi everyone i have a tos a80 and using turbo c++ but in my program ther is sumtihng wrong... can anyone help me??
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <io.h>
#include <string.h>
#define boyut 81
typedef struct kayit{
char isim[10];
char soyisim[20];
char telno[12];
}KAYIT;
main(){
KAYIT ogr,str;
FILE *di;
int i,m,kaysay;
char isim[10];
fpos_t yer;
clrscr();
di=fopen("e:\\AR-GE\\dosya\\isim.dat","a+b");
gets(ogr.isim);
gets(ogr.soyisim);
gets(ogr.telno);
m=fwrite(&ogr,sizeof(KAYIT),1,di);
m=fileno(di);kaysay=filelength(m)/sizeof(KAYIT);
fseek(di,0,0);
for(i=1;i<=kaysay;i++){
fseek(di,sizeof(KAYIT),1);
fread(&ogr,sizeof(KAYIT),1,di);
printf("\n%s %s %s\n",str.isim,str.soyisim,str.telno);
}
printf("dosyan?n boyutu %d BYTE'dir.",filelength(m));
fclose(di);
getch();
}
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <io.h>
#include <string.h>
#define boyut 81
typedef struct kayit{
char isim[10];
char soyisim[20];
char telno[12];
}KAYIT;
main(){
KAYIT ogr,str;
FILE *di;
int i,m,kaysay;
char isim[10];
fpos_t yer;
clrscr();
di=fopen("e:\\AR-GE\\dosya\\isim.dat","a+b");
gets(ogr.isim);
gets(ogr.soyisim);
gets(ogr.telno);
m=fwrite(&ogr,sizeof(KAYIT),1,di);
m=fileno(di);kaysay=filelength(m)/sizeof(KAYIT);
fseek(di,0,0);
for(i=1;i<=kaysay;i++){
fseek(di,sizeof(KAYIT),1);
fread(&ogr,sizeof(KAYIT),1,di);
printf("\n%s %s %s\n",str.isim,str.soyisim,str.telno);
}
printf("dosyan?n boyutu %d BYTE'dir.",filelength(m));
fclose(di);
getch();
}