Archived

This topic is now archived and is closed to further replies.

ZMeyer688

dev c++

Recommended Posts

ok do any of u kno y my dev c++ is so different from everyone elses i have the latest version and every time i try to do a hello world thing on it besides the one that is already on there it never works. i kno how to make it work now but every time i try to write somethin else on it it doesnt work either. like a lot of people with it can still have the iostream.h and i cant have the .h on that and i have to change a bunch of things to make work the same as the tutorials i have looked at for dev c++, i dont know if what i just said makes any sense to u haha but i tried Shit happens when you party naked!!!

Share this post


Link to post
Share on other sites
Can you show us your code?

EDIT: And Dev-C++ is known to mess up on some computers. How, I don't know.




"Give a man a fish and he will eat for a day. Teach a man how to fish and he will eat for a life time."
-Chinese Proverb

WiseElben.com - Experience Wisdom


[edited by - WiseElben on January 15, 2004 5:00:55 PM]

Share this post


Link to post
Share on other sites
Im willing to bet it flashes for a split second. Try adding cin or something to keep it from ending.

#include <iostream.h>

int main()
{
int wait = 0;

cout << "Hello world!";

cin >> wait;
return 0;
}

Share this post


Link to post
Share on other sites
quote:
Original post by dsage
Im willing to bet it flashes for a split second. Try adding cin or something to keep it from ending.

#include <iostream.h>

int main()
{
int wait = 0;

cout << "Hello world!";

cin >> wait;
return 0;
}


with dev-cpp iosteam.h generates an error. iostreme .h is decrepid.
try this:

#include <iostream>

int main()
{
int wait = 0;

std::cout << "Hello world!";

std::cin >> wait;
return 0;
}

i like dev-cpp. i use dev-cpp .

[Mercury Software] [Google!]

[edited by - DerAngeD on January 15, 2004 6:15:00 PM]

Share this post


Link to post
Share on other sites
"give MinGW DevStudio a try"
nah dude, that''s so bloaty, and even I couldn''t compile anything with it and I''ve been with cygwin+mingw for some time now..

Get devC to work, or you suck and should stop trying.
(just playing)
;D

Share this post


Link to post
Share on other sites
yea i already kno how to make the hello world thing but theres different commands that i have to put in for everything like for hello world i have to put using namespace std; and the system pause thing and when i try and make somethin else like a calculator or somethin it doesnt work and i get a bunch of errors because i need some extra commands or somethin that no1 has to use at least on the tutorials with dev c++ their programs like calculators work and mine wont with the exact same code

Shit happens when you party naked!!!

Share this post


Link to post
Share on other sites
In the earlier version of dev, when you created a new consol app, the fallowing code would be generated.

#include <iostream.h>
#include <stdlib.h>

int main()
{

system("PAUSE");
return 0;
}

the line your looking for is system("PAUSE");, this will display a message before terminating the program, allowing you to see the text that has been printed to the screen

Share this post


Link to post
Share on other sites
It sounds like your problems are in no way related to Dev-C++ or even MinGW (the compiler that Dev-C++ uses). I think you need to read up on the C++ standard seeing as how you don''t understand why you should use iostream.h or what using namespace std does. I can almost guarantee that will solve your problems.

Share this post


Link to post
Share on other sites
quote:
Original post by node128
In the earlier version of dev, when you created a new consol app, the fallowing code would be generated.

#include <iostream.h>
#include <stdlib.h>

int main()
{

system("PAUSE");
return 0;
}

the line your looking for is system("PAUSE");, this will display a message before terminating the program, allowing you to see the text that has been printed to the screen



yet again dev will error you about iostreme.h go with my above coad or the coad it generates in its new beta 5 version.

[Mercury Software] [Google!]

Share this post


Link to post
Share on other sites
ok listen i kno what using namespace std does and some other thing but not very much because im just starting tryin to learn this but i kno what system pause does and i use it but this is the code i have to use to make the hello world work

#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char *argv[])
{

system("PAUSE");
return 0;
}

most other people that have sent me codes for the hello world have very few things on it and theirs work fine but mine wont work with a real simple code that people give me and ive tried about 5 or 6 different ways that people use to do it but for some reason it wont work on mine

Share this post


Link to post
Share on other sites
i mean this is hte code that was somethin i just pasted from another thing


#include <iostream>

using namespace std;

int main (int argc, char *argv[])
{
cout << "Hello World!" << endl;
cout << "Press ENTER to continue..." << endl;
cin.get();
return 0;
}

Shit happens when you party naked!!!

Share this post


Link to post
Share on other sites
ahhhhh this is so damn frustrating i cant even begin to understand it without a really good tutorial or somethin so do any of u kno any good online tutorials or anything

Shit happens when you party naked!!!

Share this post


Link to post
Share on other sites
You must be really confused and lost, because you are not even presenting any concrete questions or specific problems you are having that anyone can help you with. For instance, the last piece of code you pasted will work perfectly fine across any legitimate compiler. So I''ll begin from there. What is the problem? I do think that online tutorials might not be enough for you. There are good books such as Accelerated C++ or C++ Primer, maybe give them a try. I can''t vouch for C++ Primer, but Accelerated C++ is not a book that holds your hand along the way. The authors of that book expect their readers to think critically and experiment for themselves to figure out those "what-ifs". But if you can browse either of those books and they are too much, then I don''t know...perhaps C++ for Dummies might be at your level.

Share this post


Link to post
Share on other sites
*offtopic*


sorry,
quote:
Original post by ZMeyer688
yea i already kno how to make the hello world thing but theres different commands that i have to put in for everything like for hello world i have to put using namespace std; and the system pause thing and when i try and make somethin else like a calculator or somethin it doesnt work and i get a bunch of errors because i need some extra commands or somethin that no1 has to use at least on the tutorials with dev c++ their programs like calculators work and mine wont with the exact same code

but that''s gotta be the longest sentence ever.

Share this post


Link to post
Share on other sites
have to agree with alnite there. That''s one hell of a runon.

Anyway, I have another suggestion, maybe you should give borland''s compiler a try instead. That''s the one I use and it seems to support the deprecated code quite well. Maybe you''ll have better luck compiling those example code you''re having trouble with using borland''s compiler instead.

Important note though, just because you can use iostream.h and the other std heads .h doesn''t mean you should. Use the standard library that''s in the std namespace.





--{You fight like a dairy farmer!}

Share this post


Link to post
Share on other sites
Ok, listen. You have the newer version of Dev C++ which includes MinGW 3.1.something. Your friends have the OLDER version of Dev C++ which has an OLDER version of MinGW (the compiler).

You're trying to feed it code that's not standards compliant.

is not standards compliant.
is.

This should work for you:

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
cout << "Hello, World!" << endl;
system("PAUSE");
return 0;
}

Do not use anything with a .h attached, they are outdated, useless compared to their updated versions.

Get a freakin' book, the tutorials online are HORRIBLY outdated.




[edited by - Drevay on January 16, 2004 1:28:35 AM]

Share this post


Link to post
Share on other sites
And I'm sorry to burst your bubble but: Programming is far from simple. Just because your friends did something with "less code" doesn't mean crap. It's a hello world app, it's not that big. Big is when you get into 1,000+ lines of code. C++ programs are usually very long, lengthy and complex - so if you don't like how long the Hello World app is compared to your friends - then maybe this isn't for you.

Dev C++ is a great IDE, and since it comes with MinGW as the compiler set (Minimalist GCC for Win32), you can be sure you have an up to date compiler to feed source code into.

It's the tutorials that you are reading that are messed up, so to speak.

Get a book. Seriously.

// EDIT - And you do NOT want to learn C before you learn C++.
// C++ is a better C by far, and OOP isn't all that bad, cosidering
// it is much more organized than procedural.
// Just get a book on C++ (a good one, ask around) and study that from
// cover to cover. Good luck.

[edited by - Drevay on January 16, 2004 1:35:25 AM]

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.