×

Loading...

It seems that you are an expert in C++, could you please help me? Just some simple questions.Thank you!

本文发表在 rolia.net 枫下论坛I installed VC++6.0 this morning and tried the program. But it still had some problems:
1, I want to know a function that can read the current time of the system, and how to use it. Is it read the seconds or the minutes?In C, it is called biostime().
2, I built the .exe file and I ran it. The program first just read some parameters as you input them, and also the .dat file name. Please see below:

1 printf(" Please input learning factor---Et & dEt: (
Note:0.1>=Et>=0) \n");
2 scanf("%f",&Et);
3 scanf("%f",&dEt);

4 printf(" Please slope value of g() --- alfa:\n");
5 scanf("%f",&alfa);
6 printf(" Please input learning factor---beita:\n");
7 scanf("%f",&beita);
8 printf(" Please input learning factor---bstep:\n");
9 printf(" ( Note: 0.1beita>bstep>0.000 ) \n");
10 scanf("%f",&bstep);

11 gets(ldfnm);
12 printf(" Please input learning data file name(iol?.dat):\n");
13 gets(ldfnm);

14 sss=fopen(ldfnm,"r");
15 fscanf(sss,"%d%d",&inputN1,&inputN1);
16 fscanf(sss,"%d",&modelN);
17 outputN=62;
18 position=ftell(sss);
19 p=position;
20 fclose(sss);

So the above part works until line 13, I can input all those parameters. But when I input the .dat file name (line 12 stll works), it stop working. A window jump out and said that
"Debug assertion failure.
Program: D:\program\Debug\learning.exe
File: fscanf.c
Line: 54
expression: streams!=NULL"

Could you please tell what's wrong with the program? What means assertion failure?How to deal with it?
Thank you very much!更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report