Saving

Started by
14 comments, last by Chad Smith 17 years, 4 months ago
Okay I'm using dec c++ and then I'm reading tutorials that are for extreme begginers (newbs) and then i put this in one of the source files. 1: #include <iostream.h> 2: 3: int main() 4: { 5: cout << "Hello World!" << endl; 6: return 0; 7: } Then i click exit (X) and i save that source file as hello.cpp... A little later it comes up with a random error saying "Access violation at address 00403CCA in module 'DevCpp.exe'. Read of address 00001943" P.S: If you say remove the numbers that still doesn't fix the problem. Help?
Advertisement
Thats weird, what OS are you on?
what devC++ version do you have?
it caused me a lot of problems, too, until i got a hang of it.
umm.. i have a bloodshed Dev-C++ 4 if that is answering your question

and i don't really know of what you meant when you said OS
Well, Theres not much anyone can do with that kindof info, there is that technical info... but its really technical. Although, when I used dev-cpp I got that type of message somewhat often, compared to other apps; one of the reasons I switched to VC++ Express
Okay... I'll just not use that type of application then...

What's a good type of compiler you can make decent games with?

Even though I probally won't make games in a week, I just want to be prepared :)
OS = operating system. That's windows :)

Stick with DevC++ if you like it. Really.
One thing i don't like about devc++ is that i can't group and collapse functions (visually) but then again, i can jump between them, so it's about the same effect.

I've got v. 4.9.9.0 on windows, and except some weird errors (sometimes) when i modify what libraries it should link to, it's not such a bad compiler and IDE.

Now, to your problem.
Do you know how to compile the code?
What you write should be transformed into an exe. In devc++, do that by pressing F9. it will also run that app for you, in a console window.

But it will end immediatley, so i suggest two variants.
The first is to actually run it from the console. Go with cd and cd .. to the folder where it compiled (the same where you saved the project, ussually), and type it's name. You'll see the result! :)

Another (but ussualy bad) method is to add
system("pause");

before line 6 (return 0;) which will call another program and put your program in a "sleeping" state, waiting for you to hit a key.

other compilers i know of and tested are microsoft's visual c++ and codeblocks.
I can't compile the code because the stuff i write in a source file always gets deleted because of that stupid error :(
try just typing that into notepad and saving it that way ... (and pick ASCI as the type of encoding)

then open it in DevC++ and see if it still crashes.

Sounds like you simply have a bad install of dev-c++. Try uninstalling it ... then reboot your computer, then download again and reinstall.
Although this won't fix the problem at hand, I am compelled to note that your tutorial is *many* years out of date, and you should discard it. Proper code is as follows (among other similar options):

#include <iostream>int main() {  std::cout << "Hello World!" << std::endl;}


Also, read the forum Forum FAQ and see how to format code properly for posting.

This topic is closed to new replies.

Advertisement