![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
Help.
Hey i bought the SAMS LEARN C++ IN 24 HOURS, and it came with a compiler, well I put this code in;
#include <iostream> int main() { std::cout << "WHATS UP DOG!\n"; return 0; } Why Wont it work? Should i use another compiler? |
|
|
|
|
|
#2 |
|
Programmer
|
//edit ---forget it---
//edit2 hmm the code seems to be right, so what does the compiler tell you why i doenst work.. any error messages ? or does compiling work and u cant execute it? well in this case it does work u cant just see the window which contains the output, so you have to add for example std::cin.get(); then the window "waits" for the next "enter"
__________________
of all the things he has lost, i think he misses his mind the most typedef typename pizza_t<oven_policy<225,12.5>,ingredient_policy<salami,mushroom,cheese> > Pizza; |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
Chances are it works fine... it just goes away before you can see it...
Shapeless has some good suggestions... an alternative is: #include <cstdlib> ... system("PAUSE");
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Programmer
|
Ok i did it. But im using C++ Builder X, or xx. And it comes up on the bottom iwth the where the file is and then under it, it says Hello World!, But im confused becuz it doesnt come up in a actual console.
|
|
|
|
|
|
#5 |
|
Programmer
|
Ok instead of using the C++ builder X, i used Dev-C++ the one eleryone talks about, And it worked!, But how do i save it as the exe, so when i click the file it just runs the actual thing
|
|
|
|
|
|
#6 |
|
PFO Founder
![]() ![]() |
when you compile it in dev-c++ it will create the .exe for you using the same name as the project i believe in the same folder you saved the files
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#7 |
|
Programmer
|
Ok i saved it after compiling, it juste has the soruce file and all that saved.. no exe.
|
|
|
|
|
|
#8 | |
|
Programmer
|
Quote:
if compiling and linking is successfull , the ide will build the .exe which of course is in the same directory ( using dev-cpp)
__________________
of all the things he has lost, i think he misses his mind the most typedef typename pizza_t<oven_policy<225,12.5>,ingredient_policy<salami,mushroom,cheese> > Pizza; |
|
|
|
|
|
|
#9 |
|
Programmer
|
Ya i saved it and then three files came up. HelloWold.cbx , hello.cbx.local , Helloworld.cpp... What do i do to run it out of the compiler. with those files.
EDIT IF SOMEONE HAS AIM , Plz aim me at ANGELpaintball44 |
|
|
|
|
|
#10 |
|
Highly Adaptive Penguin
Join Date: May 2005
Location: United States
Posts: 252
Rep Power: 4
![]() |
#include <iostream>
using namespace std //add this here
int main()
{
std::cout << "WHATS UP DOG!\n";
return 0;
} |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|