ZFGC

Projects => Discussion => Topic started by: joeshmo on April 12, 2006, 03:07:15 am

Title: Greatest C++ program to exist
Post by: joeshmo on April 12, 2006, 03:07:15 am
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!
Title: Re: Greatest C++ program to exist
Post by: gm112 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
Title: Re: Greatest C++ program to exist
Post by: joeshmo on April 12, 2006, 03:27:37 am
hmm, cin.get() didnt work here though. Got any alternatives?
Title: Re: Greatest C++ program to exist
Post by: gm112 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!
Title: Re: Greatest C++ program to exist
Post by: joeshmo on April 12, 2006, 03:30:41 am
Thanks alot gm! Any other great programs? Post em here.
Title: Re: Greatest C++ program to exist
Post by: gm112 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
Title: Re: Greatest C++ program to exist
Post by: joeshmo on April 12, 2006, 03:35:10 am
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?
Title: Re: Greatest C++ program to exist
Post by: gm112 on April 12, 2006, 03:36:13 am
cuz it hates everything =D
Title: Re: Greatest C++ program to exist
Post by: joeshmo on April 12, 2006, 03:37:04 am
its true. C++ does hate everything. Same with most programing languages.
Title: Re: Greatest C++ program to exist
Post by: therabidwombat on April 12, 2006, 06:21:14 am
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.
Title: Re: Greatest C++ program to exist
Post by: AoDC on April 12, 2006, 07:46:19 am
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 :/
Title: Re: Greatest C++ program to exist
Post by: Ben on April 12, 2006, 10:11:16 am
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.
Title: Re: Greatest C++ program to exist
Post by: aab on April 12, 2006, 04:29:56 pm
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;
}
Title: Re: Greatest C++ program to exist
Post by: Halu on April 12, 2006, 06:51:10 pm
XD, that was Pretty Funny Joe :P

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