>_< I know it's bad. I kind of built it up to make it look like what i want it to do then i make it work... ill try sort the things you've mentioned. Thanks.
>_< I know it's bad. I kind of built it up to make it look like what i want it to do then i make it work... ill try sort the things you've mentioned. Thanks.
Another suggestion..
you have around 150 lines of code there.. that is... well quzah summed it up..
maybe you should try to build your program a little by little... get one *small* part working, then add somthing new. this way when you introduce a bug in the middle of writing it, you are not running all over the place trying to figure out what the problem is. you can narrow it down to what you changed last and what it affected..
get the point..
and of course pay attention to all the previous posts..
mate i know my code is crap but cant expect me to write this in the best way possible straight away. ive only ever done little programs to do small calculations before, this is the biggest program ive done and its nothin compared to what you guys can do i know. also, of that 150 lines of code is 40 lines of commenting. so 110 :POriginally Posted by xhi
i am in no position to call other people code crap.. i can barely remember what i learned yesterday to apply it to what i learn today.. so i am merely trying to suggest what i do to help myself.. compile often and fix little bits as i go..Originally Posted by Coldcore
as for the current problem..
i would think that it is with these lines ..
char inputFileName, outputFileName, inputRoman;
ifp=fopen(inputFileName, "r");
ofp=fopen(outputFileName, "w");
fopen is looking for a string (const char*).. and you are giving it a char
try to do somthing like this..
fopen("infilename", "r")
or
char filename[] = "inFileName";
fopen(filename, "r");
There's an old saying that goes "No pain, no gain."
So many times I see folks in here posting messages like:
"Please look over my code. I'm not asking you to code my project, but I need to know why it doesn't work."
Your compiler -- if properly set up -- will tell you what's wrong with your program. The reason you're not understanding what it is telling you is because you haven't learned to translate all of those error messages into words that YOU understand. Your compiler tends to assume that you ARE an experienced C programmer. (Wouldn't it be great, though, if a compiler had a --newb switch, to put those error messages in newb-speak!)
The first time you pick over each and every compiler message, and figure out what it is telling you, it's a painful and time consuming process. But believe me, doing that will make you a better programmer.
Most folks who are taking a C course in college or in high school are just concerned with getting the program to run, so that they can turn it in and get the grade. But it is my opinion that the learning REALLY comes when you're picking your way through all the errors that your first effort turns up. That PAIN is where you find your GAIN.
If you run into a compiler message you don't understand, copy and paste it into the search box on Google. That one little act can save you hours of scratching your head. Yes, sometimes you have to sift through the chaff on Google before you find the wheat, but it IS helpful.
Do that for a while, and you start to get a feel for what will and won't work.
Now, all of that doesn't even begin to cover the process of debugging once you've gotten it to compile. But that's another topic for another day.
Don't hesitate to ask for help on the forums for something you don't understand, but also, don't shy away from picking apart those error messages.
Just my 2 cents worth......