![]() |
| ||
| Assertion Failure??? I'm trying to read from a text file.I think that everything is correct!It gives me this error message: Debug Assertion Failed! Program: D:\Test\sign.exe File: fscanf.c Expression: stream != NULL For information on how your program can cause assertion failure, see the Visual C++ documentation on asserts. CAN SOMEONE HELP? #include <conio.h> |
| ||
| Re: Assertion Failure??? I strongly adivse you use code tags [code=c][/code] Also this looks like C code to me... So perhaps you should post in the C forum. Chris |
| ||
| Re: Assertion Failure??? >Expression: stream != NULL Yet more proof (as if we needed any) that checking for success is a good thing. perror is your friend, my friend: fp = fopen ( filename, "r" ); |
| ||
| Re: Assertion Failure??? thank you.Now the program is running but it doesn't work correct.Can you give me some advises how to do it.There is a file with numbers(one number per row) the program has to printf the average value of this numbers and how many times there is "6" between them.Thank you! It must have 2 options.To write the information in file, or to printf on the screen! |
| ||
| Re: Assertion Failure??? So what isn't working now? The counting? The average? The output stream choice? Here's a cookie > float a,i; What's i initialised to? Then read the manual page on how to use printf, and what type %d is for. |
| ||
| Re: Assertion Failure??? the average and the function that count for number 6.I know when we use %d %f or etc.I just can`t find where i`m wrong.It has 0 errors and 0 warnings but it doesn`t work properly. |
| ||
| Re: Assertion Failure??? Right-click on the left margin at the first line in main(), and insert break point. Then do run->debug program. Then hover over the { } icons which appear to figure out which is "step into", "step over", "step out" etc. Use these to step through your code one line at a time. At every step, examine your variables to see if they contain what you expect. When actuality != expectation, that's a BUG. |
| All times are GMT -4. The time now is 7:21 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC