📄 pupu.c
字号:
# include <stdio.h>
# include <conio2.h>
# include <string.h>
# include <dos.h>
# include <process.h>
struct sMain
{
char item[15];
int code;
int price;
} oMain;
struct sBillRecord
{
int code;
int qty;
}; //oBillRecord;
struct sBill
{
int billno;
char cust[25];
int dd;
int mm;
int yy;
struct sBillRecord oBillRecord[10];
int amt;
} oBill;
void destroya(struct sMain cMain)
{
strcpy(cMain.item,"");
cMain.code=0;
cMain.price=0;
}
void destroyb(struct sBill cBill)
{
int i;
cBill.billno=0;
strcpy(cBill.cust," ");
//cBill.dd=0;
//cBill.mm=0;
//cBill.yy=0;
for(i=0;i<10;i++)
{
cBill.oBillRecord[i].code=0;
cBill.oBillRecord[i].qty=0;
}
cBill.amt=0;
}
int getCurItemNo()
{
int n=0;
FILE *f1;
if((f1= fopen("./DATA/Items.dat", "rb+"))==NULL)
{
fprintf(stderr, "Cannot open the bill file");
return 0;
}
while(!feof(f1))
{
fread(&oMain,sizeof(oMain)+1,1,f1);
n=getMax(n,oMain.code);
}
n++;
fclose(f1);
return n;
}
void m_getdata() //UNTUK INPUTAN BARANG
{
fflush(stdin);
oMain.code=getCurItemNo();
gotoxy(25,7);
printf("KODE=%d",oMain.code);
//scanf("%d", &oMain.code);
gotoxy(25,9);
printf("ITEM=");
fflush(stdin);
//scanf("%25s",oMain.item);
gets(oMain.item);
gotoxy(25,11);
printf("HARGA=");
scanf("%d", &oMain.price);
}
void m_showdataA(int ro) //UNTUK LISTING KODE BARANG
{
gotoxy(20,ro);
printf("%-3d ", oMain.code);
//gotoxy(25,ro);
printf("%-15s ", oMain.item);
//gotoxy(42,ro);
printf("%-6d", oMain.price);
}
void m_showdataB() //MENGEDIT HARGA BARANG
{
gotoxy(25,11);
printf("KODE: %d", oMain.code);
gotoxy(25,13);
printf("ITEM: %s", oMain.item);
gotoxy(25,15);
printf("HARGA: %d", oMain.price);
}
void BoxTitle() //UNTUK MENAMPILKAN JUDUL
{
int i;
int x1=25,y1=1,x2=55,y2=3;
gotoxy(x1,y1);
printf("%c", 218); //
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -