| View previous topic :: View next topic |
| Author |
Message |
Negima I post too much
Reputation: 6
Joined: 22 May 2007 Posts: 2221
|
Posted: Sun Mar 23, 2008 12:15 am Post subject: problem with dev C++ |
|
|
| When I press compile it compiles the script but when I click run nothing happens. Does anyone know how I can fix this?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Mar 23, 2008 12:17 am Post subject: |
|
|
Personal opinion, use a better compiler and IDE. I suggest upgrading to VS2005/2008
As for your issue, probably due to an error, or because you coded a console window with no pause method to prevent it from closing after executing what ever code you wrote. Please paste the code so we can see for ourselves to try to better help you.
_________________
- Retired. |
|
| Back to top |
|
 |
Negima I post too much
Reputation: 6
Joined: 22 May 2007 Posts: 2221
|
Posted: Sun Mar 23, 2008 12:19 am Post subject: |
|
|
It's a very simple Hello world program:
| Code: | #include <iostream.h>
int main ()
{
count << "Hello World!\n";
return 0;
}
|
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Sun Mar 23, 2008 12:21 am Post subject: |
|
|
| Negima wrote: | It's a very simple Hello world program:
| Code: | #include <iostream.h>
int main ()
{
count << "Hello World!\n";
return 0;
}
|
|
It will close immediately because it doesn't pause.
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Mar 23, 2008 12:22 am Post subject: |
|
|
| Code: | #include <iostream>
int main(void)
{
std::cout << "Hello, world!\n";
return 0;
} |
|
|
| Back to top |
|
 |
Negima I post too much
Reputation: 6
Joined: 22 May 2007 Posts: 2221
|
Posted: Sun Mar 23, 2008 12:32 am Post subject: |
|
|
| Xenophobe wrote: | | Negima wrote: | It's a very simple Hello world program:
| Code: | #include <iostream.h>
int main ()
{
count << "Hello World!\n";
return 0;
}
|
|
It will close immediately because it doesn't pause. | So basically it is opening its just closing so quickly that it doesn't even open up a window?
Also: Can a IDE such as VS make console programs?
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Sun Mar 23, 2008 12:36 am Post subject: |
|
|
| Negima wrote: | | Xenophobe wrote: | | Negima wrote: | It's a very simple Hello world program:
| Code: | #include <iostream.h>
int main ()
{
count << "Hello World!\n";
return 0;
}
|
|
It will close immediately because it doesn't pause. | So basically it is opening its just closing so quickly that it doesn't even open up a window?
Also: Can a IDE such as VS make console programs? |
Yes, Visual Studio can make console applications.
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
spectrum Expert Cheater
Reputation: 0
Joined: 27 Mar 2007 Posts: 143
|
Posted: Sun Mar 23, 2008 8:51 am Post subject: |
|
|
| Code: | #include <iostream.h>
int main ()
{
cout << "Hello World! \n";
return 0;
}
|
just add a "getch ();" or a "delay(2000);" before the "return 0;" the first will get you to type a character adn then it will close, the second will wait 2 seonds before closing.
_________________
C++ {||||||||||}
ASM {||||||||||}
Last edited by spectrum on Sun Mar 23, 2008 10:16 am; edited 1 time in total |
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sun Mar 23, 2008 8:58 am Post subject: |
|
|
All of you do know it is
and not...
And if you want it to pause do this right before return 0;
| Code: |
system("pause");
retur 0; |
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
spectrum Expert Cheater
Reputation: 0
Joined: 27 Mar 2007 Posts: 143
|
Posted: Sun Mar 23, 2008 9:15 am Post subject: |
|
|
people have told me not to use system("pause")
and lol for the typo
_________________
C++ {||||||||||}
ASM {||||||||||} |
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sun Mar 23, 2008 9:37 am Post subject: |
|
|
Well, you can do it how every you want. I perfer this code
| Code: |
#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
while (true) {}
return 0;
}
| [/url]
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
HalfPrime Grandmaster Cheater
Reputation: 0
Joined: 12 Mar 2008 Posts: 532 Location: Right there...On your monitor
|
Posted: Sun Mar 23, 2008 10:17 am Post subject: |
|
|
| Negima wrote: | It's a very simple Hello world program:
| Code: | #include <iostream.h>
int main ()
{
count << "Hello World!\n";
return 0;
}
|
|
It shouldn't have compiled. If you look down at the bottom, a little error window should've opened up.
|
|
| Back to top |
|
 |
dark12222000 Newbie cheater
Reputation: 0
Joined: 23 Mar 2008 Posts: 15
|
Posted: Sun Mar 23, 2008 4:47 pm Post subject: Bloodshed Dev C++ rocks |
|
|
| First off, I love Dev C++, because it's an IDE for MingW, a port of G++. It's a great IDE, but, it is very simple, and lacks all the nice tools of visual studio. If your program isn't building, make sure you created a new project, not just a new script. New > Project > Console Application. I use dev c++ for my main compiler, so, feel free to ask me if you need any help with it.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Mar 23, 2008 5:56 pm Post subject: |
|
|
| HornyAZNBoy wrote: | Well, you can do it how every you want. I perfer this code
| Code: |
#include <iostream>
int main()
{
std::cout << "Hello World" << std::endl;
while (true) {}
return 0;
}
|
|
that is awful, awful practice.
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sun Mar 23, 2008 6:14 pm Post subject: |
|
|
I have a quad core, and 2GB or RAM, that does not slow down my computer one bit.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
|