Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is wrong bout this??

Status
Not open for further replies.

dejawux

Programmer
Aug 22, 2005
3
TR
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();
}




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top