![]() |
|
#1
|
|||
|
|||
Assertion expression error (str != NULL)Hi, im doing a program that converts from a roman number to a numerical number and im trying to write on the screen and also on a file that i created, the program shows no erros opens and when i enter the the numbers to convert it shows me the assertion error i think its related to the fprintf but im not sure hope someone could help im a begginer at this, heres the code:
CPP / C++ / C Code:
Last edited by admin : 16-Jun-2012 at 13:53.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|||
|
#2
|
|||
|
|||
Re: Assertion expression error (str != NULL)Quote:
OK, here's the deal: For you to have a reasonable expectation of getting meaningful help in learning how to debug programs like this, I recommend the following:
Regards, Dave __________________
Sometimes I just can't help myself... |
|
#3
|
|||
|
|||
Re: Assertion expression error (str != NULL)ok, i´ll try to explain it better, so here's all my code:
CPP / C++ / C Code:
Last edited by admin : 16-Jun-2012 at 13:54.
Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
|
|
#4
|
|||
|
|||
Re: Assertion expression error (str != NULL)Quote:
Hmmm. I see the code. but it can't be compiled with my compiler: Compiler messages (GNU gcc version 4.1.2 on my Centos 5.8 Linux workstation) are Code:
I hate to repeat myself, but suggestion number 1 was to submit a program that we can compile and execute. I mean, you previously had a program that you could compile and execute, right? I don't see any explanation or responses to my other suggestions. Were any parts of my previous suggestions unclear? Would you like to try one more time? Regards, Dave __________________
Sometimes I just can't help myself... |
|
#5
|
|||
|
|||
Re: Assertion expression error (str != NULL)ok, i´ll try to explain it better, so here's all my code:
CPP / C++ / C Code:
so the problem resides when start the program and enter "2" on the menu, i input how many numbers i want to convert lets says i input "1" the the program asks me to input a roman number i input "VII" and i get the output of that number in normal "7" number but when i get the output the assertion error appears and this problem appeared when i started inputing the file part of the program in the "case 2:" and what im aiming to acomplish is when the output is showned on the screen its also written in the file that i created. The function "teclado" converts the roman number and return a numerical number. can someone help me? |
|
#6
|
|||
|
|||
Re: Assertion expression error (str != NULL)Quote:
sorry about that i sent it by mistake before writting the explanation |
|
#7
|
|||
|
|||
Re: Assertion expression error (str != NULL)Quote:
Are you sure that you are compiling it as a C program? (What is the name of the source code file?) It will not compile as a C program with any of the various Borland, Microsoft and GNU compilers that I have at my disposal. I showed error messages from attempts to compile with a GNU compiler, I won't bore you with details of error messages from my other compilers. What I would like to know is what you are using and how you are compiling. I did suggest that you tell us what compiler and operating system you are using, which you have not, so far, chosen to do. I should have also suggested that you tell us how you are compiling. (From command line, from Integrated Development Environment such as Visual Studio, or what?) Here's the thing: There is no way that I can see to help you learn to debug your C program unless we start on the same page. I mean, regardless of C-language syntax problems there are some non-standard usages and some places where undefined behavior can result, but I don't see any point in my guessing... Regards, Dave __________________
Sometimes I just can't help myself... |
|
#8
|
|||
|
|||
Re: Assertion expression error (str != NULL)I compiled the program with visual studio 2010
|
|
#9
|
|||
|
|||
Re: Assertion expression error (str != NULL)I solved the problem and now i write into the file, sorry about my bad explanation of the problem, if i get some other error, and i dont understand i´ll try to explain it better, but thanks anyways.
|
Recent GIDBlog
GID Spam Detector 1.1.0 by gidnetwork
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [MFC] How to enable scrollbars in DIBLOOK result window? | szmitek | MS Visual C++ / MFC Forum | 0 | 19-Dec-2011 18:58 |
| C++ Linker errors | Rui Jorge Cossa | C++ Forum | 2 | 27-Oct-2011 23:51 |
| join problem | zuzupus | MySQL / PHP Forum | 0 | 14-Aug-2003 05:11 |
| MySQL Syntax Error | DropZite | MySQL / PHP Forum | 3 | 09-Jul-2003 04:00 |
Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The