Go Back   Forums > Community Chatterbox > Tech Corner > Programming
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 14-11-2008, 11:30 PM   #1
Fubb
GreatCanadianMan
 
Fubb's Avatar


 
Join Date: May 2008
Location: Swan River, Canada
Posts: 842
Default New to C++, and need halp!

Ok, I have made a sample .cpp file...and here is the code. Im using Notepad++

code:

/*
This is a simple C++ program.
Call this file Sample.cpp.
*/

#include <iostream>
using namespace std;

// A C++ program begins at main().
int main()
{
cout << "C++ is power programming.";
return 0;
}


This is where i run into problems, how can I compile it? My original though was using the Visual C++ compiler code, which is something liek this:

C:\...>cl -GX Sample.cpp

coares that wouldn't make sense, as i dont have visual C++, i only HAVE notepad++. I need a way to compile my .cpp file, any suggestions? or could i make a simple compiler myself? If i got the code, and the compiler was a .exe or something, that compiled .cpp to .exe or something, I could do it, coares i'd need to know how to do that first.

ANYWAYS, so i need help compiling my .cpp file.
Fubb is offline                         Send a private message to Fubb
Reply With Quote
Old 15-11-2008, 12:08 AM   #2
_r.u.s.s.
I'm not Russ
but an ex-alektorophobic
 
_r.u.s.s.'s Avatar


 
Join Date: May 2005
Location: Nitra, Slovakia
Posts: 6,533
Default

http://www.google.com/search?hl=en&s...ee&btnG=Search
__________________
_r.u.s.s. is offline                         Send a private message to _r.u.s.s.
Reply With Quote
Old 15-11-2008, 12:35 AM   #3
Fubb
GreatCanadianMan
 
Fubb's Avatar


 
Join Date: May 2008
Location: Swan River, Canada
Posts: 842
Default

Oh thanks!
Fubb is offline                         Send a private message to Fubb
Reply With Quote
Old 15-11-2008, 08:05 AM   #4
AlumiuN
Vodka-Induced Entertainment
 
AlumiuN's Avatar

 
Join Date: Jan 2008
Location: Christchurch, New Zealand
Posts: 1,044
Default

Here's the one I use: DevC++ 4.9.9.2 (Beta 5)

To compile your sample code, just load it in Dev and hit the compile button.
__________________


Lies are for those who cannot handle the truth, but truth is for those who cannot handle the lies.
AlumiuN is offline                         Send a private message to AlumiuN
Reply With Quote
Old 15-11-2008, 02:38 PM   #5
Fubb
GreatCanadianMan
 
Fubb's Avatar


 
Join Date: May 2008
Location: Swan River, Canada
Posts: 842
Default

using DevC++, i put the .cpp file in, and said compile, and it said it did, but to where did it compile? And when i clicked "run", the command prompt would open for like 1/8th of a second then close. Hm

ANYWAYs, while i figure this out, ima also make more codes.
__________________
Kugarfang: o hai guiz im trying to find this techno song from the radio and it goes like this:

DUN duuuunnnn dudududududun SPLOOSH duuunnnnn


We ate the horse.
Fubb is offline                         Send a private message to Fubb
Reply With Quote
Old 15-11-2008, 09:51 PM   #6
_r.u.s.s.
I'm not Russ
but an ex-alektorophobic
 
_r.u.s.s.'s Avatar


 
Join Date: May 2005
Location: Nitra, Slovakia
Posts: 6,533
Default

fubb, if you don't know what are you doing, don't do it
__________________
_r.u.s.s. is offline                         Send a private message to _r.u.s.s.
Reply With Quote
Old 15-11-2008, 10:11 PM   #7
Fubb
GreatCanadianMan
 
Fubb's Avatar


 
Join Date: May 2008
Location: Swan River, Canada
Posts: 842
Default

well no my pc just down't agree with the Comand Prompt whatsoever. Maybe if they were .bats...
__________________
Kugarfang: o hai guiz im trying to find this techno song from the radio and it goes like this:

DUN duuuunnnn dudududududun SPLOOSH duuunnnnn


We ate the horse.
Fubb is offline                         Send a private message to Fubb
Reply With Quote
Old 15-11-2008, 10:22 PM   #8
dosraider
Dismembered.
 
dosraider's Avatar

 
Join Date: Aug 2007
Location: Dixmuide, Belgium
Posts: 2,767
Default

Quote:
Originally Posted by _r.u.s.s. View Post
fubb, if you don't know what are you doing, don't do it
Story of my life, never know what I'm doing, but I do it anyway.
:bleh:
__________________

Not a member of The Victorious People's Shoutbox Liberation Army.
Not a member of the GAG Guerrilla. Don't get A Grip!
FOR RENT
*Advertising space*
dosraider is offline                         Send a private message to dosraider
Reply With Quote
Old 15-11-2008, 11:47 PM   #9
AlumiuN
Vodka-Induced Entertainment
 
AlumiuN's Avatar

 
Join Date: Jan 2008
Location: Christchurch, New Zealand
Posts: 1,044
Default

Quote:
Originally Posted by Fubb View Post
using DevC++, i put the .cpp file in, and said compile, and it said it did, but to where did it compile? And when i clicked "run", the command prompt would open for like 1/8th of a second then close. Hm

ANYWAYs, while i figure this out, ima also make more codes.
Probably because it prints it then quits. Put a system("pause"); before return 0; and you will also need to add #include <stdlib.h> below #include <iostream> (well, I think stdlib.h is the right one...)
__________________


Lies are for those who cannot handle the truth, but truth is for those who cannot handle the lies.
AlumiuN is offline                         Send a private message to AlumiuN
Reply With Quote
Old 16-11-2008, 12:48 AM   #10
Fubb
GreatCanadianMan
 
Fubb's Avatar


 
Join Date: May 2008
Location: Swan River, Canada
Posts: 842
Default

kk thanks!
__________________
Kugarfang: o hai guiz im trying to find this techno song from the radio and it goes like this:

DUN duuuunnnn dudududududun SPLOOSH duuunnnnn


We ate the horse.
Fubb is offline                         Send a private message to Fubb
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Discworld & Fable halp! Fubb Troubleshooting 5 30-05-2008 08:26 AM
Halp! Marvin Old Suggestions 11 14-12-2007 08:45 PM


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 11:44 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.