OK, I now have
Code:
struct menuDetail {
char MenuDes0[25];
char filler01[06];
char MenuNam0[06];
<snip>
};
struct menuDetail menuRec;
FILE *fpin1, *fpout2;
if ((fpin1=fopen("bm7000.men","r"))==NULL)
{
printf("Error input file \n");
exit (1);
}
if ((fpout2=fopen("menulst.txt","w"))==NULL)
{
printf("Error output file \n");
exit (1);
}
while (fgets(buf1,5478,fpin1)!= NULL)
{
strncpy(menuRec.MenuDes0,&buf1[0],25);
menuRec.MenuDes0[26]='\0';
strncpy(menuRec.MenuNam0,&buf1[32],06);
menuRec.MenuNam0[06]='\0';
}
endpart:
;
fprintf(fpout2," %s %s \n",menuRec.MenuDes0,menuRec.MenuNam0);
It compiles successfully, and once I took rubbish out of input file it worked great! Thanks for all your help guys!!