C语言出现for information on how you program can cause an asserti
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/10 12:28:24
C语言出现for information on how you program can cause an assertion failure
#include
#include
#include
#include
#include
#define MAX 100
typedef struct
{ char dm[5] ; /*产品代码*/
char mc[11] ; /*产品名称*/
int dj ; /*单价*/
int sl ; /*数量*/
long je ; /*金额*/
}PRO ;
PRO sell [MAX] ;
void ReadDat() ;
void WriteDat() ;
void SortDat()
{
int i,j;
PRO xy;
for(i=0;isell[j].je)
{xy=sell[i];sell[i]=sell[j];sell[j]=xy;}
}
}
main()
{
memset(sell,0,sizeof(sell)) ;
ReadDat() ;
SortDat() ;
WriteDat() ;
}
void ReadDat()
{
FILE *fp ;
char str[80],ch[11] ;
int i ;
fp = fopen("IN1.DAT","r") ;
for (i = 0 ; i < 100 ; i++)
{
fgets(str,80,fp) ;
memcpy(sell[i].dm,str,4) ;
memcpy(sell[i].mc,str + 4,10) ;
memcpy(ch,str + 14,4) ; ch[4] = 0 ;
sell[i].dj = atoi(ch) ;
memcpy(ch,str +18,5) ; ch[5] = 0 ;
sell[i].sl = atoi(ch) ;
sell[i].je = (long)sell[i].dj * sell[i].sl;
}
fclose(fp) ;
}
void WriteDat()
{
FILE *fp;
int i ;
fp = fopen("OUT1.DAT","w") ;
for(i = 0 ; i < 100 ; i++)
fprintf(fp,"%s %s %4d %5d %10ld\n",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,
sell[i].je) ;
fclose(fp) ;
}
#include
#include
#include
#include
#include
#define MAX 100
typedef struct
{ char dm[5] ; /*产品代码*/
char mc[11] ; /*产品名称*/
int dj ; /*单价*/
int sl ; /*数量*/
long je ; /*金额*/
}PRO ;
PRO sell [MAX] ;
void ReadDat() ;
void WriteDat() ;
void SortDat()
{
int i,j;
PRO xy;
for(i=0;isell[j].je)
{xy=sell[i];sell[i]=sell[j];sell[j]=xy;}
}
}
main()
{
memset(sell,0,sizeof(sell)) ;
ReadDat() ;
SortDat() ;
WriteDat() ;
}
void ReadDat()
{
FILE *fp ;
char str[80],ch[11] ;
int i ;
fp = fopen("IN1.DAT","r") ;
for (i = 0 ; i < 100 ; i++)
{
fgets(str,80,fp) ;
memcpy(sell[i].dm,str,4) ;
memcpy(sell[i].mc,str + 4,10) ;
memcpy(ch,str + 14,4) ; ch[4] = 0 ;
sell[i].dj = atoi(ch) ;
memcpy(ch,str +18,5) ; ch[5] = 0 ;
sell[i].sl = atoi(ch) ;
sell[i].je = (long)sell[i].dj * sell[i].sl;
}
fclose(fp) ;
}
void WriteDat()
{
FILE *fp;
int i ;
fp = fopen("OUT1.DAT","w") ;
for(i = 0 ; i < 100 ; i++)
fprintf(fp,"%s %s %4d %5d %10ld\n",sell[i].dm,sell[i].mc,sell[i].dj,sell[i].sl,
sell[i].je) ;
fclose(fp) ;
}
难道没人知道吗?
C语言出现for information on how you program can cause an asserti
for information on how your program can cause an assertion f
for information on how your program can cause...怎么解决!有追分!
for information on how your program can
debug assertion failed! for information on how your program
英语翻译Expression:stream!For information on how your program ca
______ useful information you've given us!A) How B) How an C
for more information,you can call_____21358754.
At school,you can look for information on this or write your
英语 1,FYI是for your information还是for you information 2,别人问how'
____good information it is.A how an B.what an C.how D.what
You can find much information on the (.).为什么?