Posted by OtZman on Thu Jan 15th at 4:35pm 2004
OtZman
member
1890 posts
199 snarkmarks
Registered: Jul 12th 2003
Location: Sweden

Occupation: Student
Posted by matt on Thu Jan 15th at 5:12pm 2004
take your pic
[addsig]
matt
member
1100 posts
190 snarkmarks
Registered: Jun 26th 2002
Location: Edinburgh

Occupation: Student!
Posted by Forceflow on Thu Jan 15th at 5:41pm 2004
Can't help it matt, but its pick.
Sorry. ![]()
Forceflow
member
2420 posts
342 snarkmarks
Registered: Nov 6th 2003
Location: Belgium

Occupation: Engineering Student (CS)
Posted by matt on Thu Jan 15th at 6:03pm 2004
matt
member
1100 posts
190 snarkmarks
Registered: Jun 26th 2002
Location: Edinburgh

Occupation: Student!
Posted by Gwil on Thu Jan 15th at 6:31pm 2004
If you can get hold of Visual Studio from "a friend" for instance, try and get it
Microsoft tool, and bizarrely enough I rate it highly
good piece of software!
Gwil
super admin
2864 posts
293 snarkmarks
Registered: Oct 13th 2001
Location: Derbyshire, UK

Occupation: Student
Posted by matt on Thu Jan 15th at 6:55pm 2004
matt
member
1100 posts
190 snarkmarks
Registered: Jun 26th 2002
Location: Edinburgh

Occupation: Student!
Posted by Edge Damodred on Thu Jan 15th at 10:30pm 2004
Edge Damodred
member
237 posts
54 snarkmarks
Registered: Apr 24th 2002
Location: I don't even know anymore

Occupation: student
Posted by Crono on Thu Jan 15th at 10:43pm 2004
Most universities use GNU (gcc for C and g++ for C++)
Unfortunatly, you're probably using windows. So this exact version wont work, however, there is a package made by several groups called Mingw, a win32 version is included in this.
Go here to read how exact to get it and how to make it work:
mingw
Go here to download it:
Download
I hope all that helps. by the way, Gwil, he said free . . . . lol.
*note: check out gnu.org it has the gnu public license on it, which basically states its always free . . . and gnu isn't unix. [addsig]
Posted by DesPlesda on Fri Jan 16th at 2:01pm 2004
DesPlesda
member
204 posts
30 snarkmarks
Registered: Feb 14th 2002
Location: Tasmania, Australia

Occupation: Student
Posted by OtZman on Fri Jan 16th at 5:45pm 2004
Now I've downloaded Dev-C++ and it seems to work fine and I've compiled my first program ever!!!
The only problem is that when I try to run the program it is closed after 1/2 seconds or less...![]()
This is the code I'm using:
#include <iostream>
using namespace std;
int main()
{
cout << "My first program ";
return 0;
}
Anyone with any ideas? What can be wrong? 
OtZman
member
1890 posts
199 snarkmarks
Registered: Jul 12th 2003
Location: Sweden

Occupation: Student
Posted by matt on Fri Jan 16th at 5:49pm 2004
matt
member
1100 posts
190 snarkmarks
Registered: Jun 26th 2002
Location: Edinburgh

Occupation: Student!
Posted by OtZman on Fri Jan 16th at 5:51pm 2004
OtZman
member
1890 posts
199 snarkmarks
Registered: Jul 12th 2003
Location: Sweden

Occupation: Student
Posted by Monqui on Fri Jan 16th at 6:15pm 2004
A window pops up that your prog is run in,
It prints out the "My first program " bit
Then the window closes because the program successfully finished
It probably is running just like it should, it's just going too fast for you to realize. Add in a cin >> or a getkey or something (its been a while since I've touched C++, so the commands might be different). [addsig]
Monqui
member
743 posts
94 snarkmarks
Registered: Sep 20th 2002
Location: Iowa, USA

Occupation: Poor College Student
Posted by Edge Damodred on Fri Jan 16th at 6:16pm 2004
| ? posted by OtZman |
|
Now I've downloaded Dev-C++ and it seems to work fine and I've compiled my first program ever!!! This is the code I'm using: #include <iostream> int main() Anyone with any ideas? What can be wrong? |
There's nothing wrong with the code in itself, it's just that console apps shut down as soon as you're finished.
You can write a batch file with the following lines
*****.exe (name of the executable)
pause
rename the text file to .bat and run it from there. Some compilers will do this for you when you run in debug mode, but not all.
That should work for you though. You could also put some kind of input statement at the end.
cout<<"Input q to quit."
char q;
cin>>q;
but that just looks bad, so go with the .bat method.
[addsig]Edge Damodred
member
237 posts
54 snarkmarks
Registered: Apr 24th 2002
Location: I don't even know anymore

Occupation: student
Posted by Crono on Fri Jan 16th at 8:14pm 2004
Then, sort of how Edge stated, create a cin>>; statement. I believe you don't have to have a variable saving the statement, because you just want the program haulted, in otherwords why would you save something you wouldn't use?
One more thing, is there any particular reason why you think you need a namespace for this program? lol [addsig]
Posted by asterix_vader on Fri Jan 16th at 8:24pm 2004
asterix_vader
member
494 posts
49 snarkmarks
Registered: Aug 29th 2003
Location: Peru

Occupation: Trying to find one
Posted by Crono on Fri Jan 16th at 8:31pm 2004
Posted by Edge Damodred on Fri Jan 16th at 8:55pm 2004
| ? posted by Crono |
One more thing, is there in particular reason why you think you need a namespace for this program? lol |
Because that's what everyone who does "Hello World" does...besides it can get annoying having to go back and grab specific components out of an object when you realized you just needed. Now when you release to the public...yeah, you'd better be getting only the things you need ![]()
Edge Damodred
member
237 posts
54 snarkmarks
Registered: Apr 24th 2002
Location: I don't even know anymore

Occupation: student
Posted by Crono on Fri Jan 16th at 8:59pm 2004
Why even bother putting it in there unless you're doing something like a hierarchy where it can actually make a difference? [addsig]
Posted by Monqui on Fri Jan 16th at 9:07pm 2004
What does it matter in this case? [addsig]
Monqui
member
743 posts
94 snarkmarks
Registered: Sep 20th 2002
Location: Iowa, USA

Occupation: Poor College Student
Snarkpit v6.1.0 created this page in 0.0392 seconds.

