Forums

Forums (http://www.abandonia.com/vbullet/index.php)
-   Programming (http://www.abandonia.com/vbullet/forumdisplay.php?f=25)
-   -   New to C++, and need halp! (http://www.abandonia.com/vbullet/showthread.php?t=18200)

Fubb 14-11-2008 11:30 PM

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.

_r.u.s.s. 15-11-2008 12:08 AM

http://www.google.com/search?hl=en&s...ee&btnG=Search

Fubb 15-11-2008 12:35 AM

Oh thanks! :D

AlumiuN 15-11-2008 08:05 AM

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. :)

Fubb 15-11-2008 02:38 PM

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.

_r.u.s.s. 15-11-2008 09:51 PM

fubb, if you don't know what are you doing, don't do it

Fubb 15-11-2008 10:11 PM

well no my pc just down't agree with the Comand Prompt whatsoever. Maybe if they were .bats...

dosraider 15-11-2008 10:22 PM

Quote:

Originally Posted by _r.u.s.s. (Post 342405)
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:

AlumiuN 15-11-2008 11:47 PM

Quote:

Originally Posted by Fubb (Post 342384)
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...)

Fubb 16-11-2008 12:48 AM

kk thanks!


The current time is 10:22 AM (GMT)

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