Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Greatest C++ program to exist  (Read 5665 times)

0 Members and 1 Guest are viewing this topic.
Greatest C++ program to exist
« on: April 12, 2006, 03:07:15 am »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
Put into your compiler and compile. Its fun.
Code: [Select]
#include<iostream>
#include<string>
using namespace std;

int main() {
int $n;
cout<<"Enter the starting number! \n";
cin>>$n;
if($n<85000) {
$n=85000;
cout<<"Your number was too low, we changed it to 85000. n_n \n";
}
while($n>0) {
cout<<$n <<'\n';
$n--;
}
cout<<"Fire! \n";
system("Pause");
}
Made by me!
« Last Edit: February 28, 2007, 09:59:08 pm by 4Sword »
Logged
  • Netterra Virtual Pets

gm112

Re: Greatest C++ program to exist
« Reply #1 on: April 12, 2006, 03:24:41 am »
heh nice.but FYI dont use system("pause") because it adds on to your file size and it kinda gives more mem usage. Practice keyhit methods =P but nice job
Logged
Re: Greatest C++ program to exist
« Reply #2 on: April 12, 2006, 03:27:37 am »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
hmm, cin.get() didnt work here though. Got any alternatives?
Logged
  • Netterra Virtual Pets

gm112

Re: Greatest C++ program to exist
« Reply #3 on: April 12, 2006, 03:29:38 am »
i havent programmed c++ in almost a year so i forget =P look up on cprogramming.com i think the link is or google "c++ key hit methods" you should get something to help you there
P.S NICE START DUDE!
Logged
Re: Greatest C++ program to exist
« Reply #4 on: April 12, 2006, 03:30:41 am »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
Thanks alot gm! Any other great programs? Post em here.
Logged
  • Netterra Virtual Pets

gm112

Re: Greatest C++ program to exist
« Reply #5 on: April 12, 2006, 03:32:44 am »
lol this is all i remember
Code: [Select]
#include <iostream.h>
int main()
{
    cout <<"Rello world!\n"endl;
    return 0;
}
lol
Logged
Re: Greatest C++ program to exist
« Reply #6 on: April 12, 2006, 03:35:10 am »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
lol this is all i remember
Code: [Select]
#include <iostream.h>
int main()
{
    cout <<"Rello world!\n"endl;
    return 0;
}
lol
Actually that code is invalid. They changed #include<iostream.h> to #include<iostream> and you now either have to put std::(sexual transmited disease) before most functions or say: using namespace std;. See why C++ is kidna confusing?
Logged
  • Netterra Virtual Pets

gm112

Re: Greatest C++ program to exist
« Reply #7 on: April 12, 2006, 03:36:13 am »
cuz it hates everything =D
Logged
Re: Greatest C++ program to exist
« Reply #8 on: April 12, 2006, 03:37:04 am »
  • Its the joeshmo!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 694
its true. C++ does hate everything. Same with most programing languages.
Logged
  • Netterra Virtual Pets
Re: Greatest C++ program to exist
« Reply #9 on: April 12, 2006, 06:21:14 am »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
lol this is all i remember
Code: [Select]
#include <iostream.h>
int main()
{
    cout <<"Rello world!\n"endl;
    return 0;
}
lol
Actually that code is invalid. They changed #include<iostream.h> to #include<iostream> and you now either have to put std::(sexual transmited disease) before most functions or say: using namespace std;. See why C++ is kidna confusing?

C++ itself is pretty straightforward, it's just a matter of keeping your libraries in mind.
Logged
  • Broken Kings [Temp Site]
Re: Greatest C++ program to exist
« Reply #10 on: April 12, 2006, 07:46:19 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
Actually that code is invalid. They changed #include<iostream.h> to #include<iostream> and you now either have to put std::(sexual transmited disease) before most functions or say: using namespace std;. See why C++ is kidna confusing?
DIfferent compilers use different things. VC++6 uses string.h, and errors if you enter it without the extension. Welcome to the real world :/
Logged
the a o d c

Ben

Re: Greatest C++ program to exist
« Reply #11 on: April 12, 2006, 10:11:16 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
lol this is all i remember
Code: [Select]
#include <iostream.h>
int main()
{
    cout <<"Rello world!\n"endl;
    return 0;
}
lol

You've broken it, XD.
Just put another << before the "Rello World!" and the enl, because they're two completely different things.
Though why you'd want an \n and an endl is beyond me.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion

aab

^ Evolved from a Hobbit
Re: Greatest C++ program to exist
« Reply #12 on: April 12, 2006, 04:29:56 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Actually that code is invalid. They changed #include<iostream.h> to #include<iostream> and you now either have to put std::(sexual transmited disease) before most functions or say: using namespace std;. See why C++ is kidna confusing?
DIfferent compilers use different things. VC++6 uses string.h, and errors if you enter it without the extension. Welcome to the real world :/
When i used vc++6 (..well..im still using uit just now but i may switch after my current project) i downloaded updated headers that were compatibe enough with vc++6 while still being more-up to date I needed them to do certain win32 things).
Erm..Ever noticed how sometimes it actually lets to do partial specification on a function template, and not on a class template?..(and other times..its the other way around).
One time i even got an error in a macro, but it was in white space: I retyped it exactly and it compiled fine.

C++ prog > U{} of C++ progs
Code: [Select]
#include<iostream>

int main()
 //Actual ascii from Wikipedia
{
using std::cout ;
using std::endl ;

cout
<<char(9)<<" ___" <<endl
<<char(9)<<"{o,o}" <<endl
<<char(9)<<"|)__)" <<endl
<<char(9)<<'-'<<'"'<<'-'<<'"'<<'-'<<endl
<<char(9)<<"O RLY?" <<endl
<<endl

<<"Press Return to continue..."
<<endl;
std::cin.get();

return 0;
}
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: Greatest C++ program to exist
« Reply #13 on: April 12, 2006, 06:51:10 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1902
XD, that was Pretty Funny Joe :P
Logged


.TakaM was here.
Quote
so my friend stole a giant bag of ketchup out of the ketchup pumping things and brought it to our table and we took it in the bathroom and i smashed it over the sink and kicked it around the bathroom and smeared it everywhere and we all took turns kicking the ketchup out of it and when we were done it looked like an african village was murdered in the bathroom
XFD.
  • Awesome Land
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.03 seconds with 66 queries.

anything