Discuss Scratch

christian2000
Scratcher
50 posts

C++

Talk about the super cool programming language here!

//POS- Potato OS

#include <iostream>
#include <cstdlib>
#include <cstdio>
using namespace std;

int main()
{ char yesNo;
cout << "POS (Potato Operating system) " << endl;
cout << "(c) 2013 christian20002 productions." << endl;
system("PAUSE");
cout << "Wut U lookin at?" << endl;
system("PAUSE");

cout << "Do you like potatoes? (Y/N)" << endl;
cin >> yesNo;


char die = '2';

if (yesNo == 'Y')
{
cout << "You'll survive- for now..." << endl;
}
else
{
cout << "muahaha. enter 1 to die!!!" << endl;
cin >> die;
if (die == '1')
{
for (;;)
{
system("COLOR 15");
system("COLOR 29");
system("COLOR 4F");
system("COLOR 15");
system("COLOR 29");
system("COLOR 4F");
system("COLOR 29");
system("COLOR 4F");
system("COLOR 29");
system("COLOR 4A");

}
}



else
{
}
}

cout << "TROLOLOL";
}

Yes, I know it uses too much system commands, but I made this in like 7 minutes after a conversation on a Minecraft server. :3

Last edited by christian2000 (June 10, 2013 17:59:03)

mythbusteranimator
Scratcher
1000+ posts

C++

It confuzzles me. O.O
zubblewu
Scratcher
100+ posts

C++

c++ isn't really useful for small things
poopo
Scratcher
100+ posts

C++

How did C++ ever become the standard.
16Skittles
Scratcher
500+ posts

C++

poopo wrote:

How did C++ ever become the standard.
I think if you're going to ask that question you might want to ask how C became standard. C++ is to C what HTML5 is to HTML. Just the next version. As for the answer to that, it's compact and fast. Those are the main reasons. I'd argue with you on which syntax is better, but I far prefer C++ over all the other languages I know. (PHP, Java, Javascript, Python)

Edit: obligatory…
#include <iostream>
int main(){
std::cout<<"Hello, World!";
}

Last edited by 16Skittles (June 10, 2013 23:14:41)

poopo
Scratcher
100+ posts

C++

16Skittles wrote:

poopo wrote:

How did C++ ever become the standard.
I think if you're going to ask that question you might want to ask how C became standard. C++ is to C what HTML5 is to HTML. Just the next version. As for the answer to that, it's compact and fast. Those are the main reasons. I'd argue with you on which syntax is better, but I far prefer C++ over all the other languages I know. (PHP, Java, Javascript, Python)

Edit: obligatory…
 }
That was more of a statement than a question. I understand the process of C++ becoming the standard. I think that C++'s syntax is atrocious, and that it is a badly developed language, so it's unfortunate that I have to learn it. T-T
veggieman001
Scratcher
1000+ posts

C++

Nothing is permanent.

Last edited by veggieman001 (July 17, 2013 03:00:49)

poopo
Scratcher
100+ posts

C++

I think that it's silly to have multiple ways of doing things when it could be done using a single style.
For example to print is
cout <<"stuff";
whereas calling a function is
object.function(parameters);
Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.
I guess if I had started with C++ I might be more used to the syntax but I didn't.
16Skittles
Scratcher
500+ posts

C++

poopo wrote:

I think that it's silly to have multiple ways of doing things when it could be done using a single style.
For example to print is
cout <<"stuff";
whereas calling a function is
object.function(parameters);
Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.
I guess if I had started with C++ I might be more used to the syntax but I didn't.
It is available as the printf() function. The distinction is that cout is a stream, not an object. Input streams use “>>” to add it to the variable and output streams use “<<” to send the output to a stream.
christian2000
Scratcher
50 posts

C++

#include <iostream>

using namespace std;

int main();
{
cout << “BUMP” << end;
}

Last edited by christian2000 (June 12, 2013 16:11:47)

poopo
Scratcher
100+ posts

C++

16Skittles wrote:

poopo wrote:

I think that it's silly to have multiple ways of doing things when it could be done using a single style.
For example to print is
cout <<"stuff";
whereas calling a function is
object.function(parameters);
Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.
I guess if I had started with C++ I might be more used to the syntax but I didn't.
It is available as the printf() function. The distinction is that cout is a stream, not an object. Input streams use “>>” to add it to the variable and output streams use “<<” to send the output to a stream.
Alright, excuse my lack of knowledge. >.< Still though, why do streams have their own syntax, why can't they just be objects?
GeonoTRON2000
Scratcher
100+ posts

C++

poopo wrote:

16Skittles wrote:

poopo wrote:

I think that it's silly to have multiple ways of doing things when it could be done using a single style.
For example to print is
cout <<"stuff";
whereas calling a function is
object.function(parameters);
Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.
I guess if I had started with C++ I might be more used to the syntax but I didn't.
It is available as the printf() function. The distinction is that cout is a stream, not an object. Input streams use “>>” to add it to the variable and output streams use “<<” to send the output to a stream.
Alright, excuse my lack of knowledge. >.< Still though, why do streams have their own syntax, why can't they just be objects?
You'd like Java.
poopo
Scratcher
100+ posts

C++

GeonoTRON2000 wrote:

You'd like Java.
I do like Java.
veggieman001
Scratcher
1000+ posts

C++

Nothing is permanent.

Last edited by veggieman001 (July 17, 2013 03:02:50)

SeptimusHeap
Scratcher
100+ posts

C++

I love Java

C# too, C++ is just so… old.
Laternenpfahl
Scratcher
500+ posts

C++

If we are going c++ instead of C in first place, please use printf and scanf
rogueinc01
New Scratcher
8 posts

C++

Hey, is anyone interested in joining my C++ study group, you would have to have Skype and the willingness to learn SDl and OpenGL, I'm writing on my IPad and it's 1 AM but in C++ programming when you get into classes and start to use private, public and protected things you can't use the above methods so they end up making functions just display something like this little code I made:
class A
{
Int a;
int b:
public:
int c;
Int d;
Int e;

void setvar()
Yada Yada


cout<<a<<endl;ERROR something like main can't access A.a, remember I'm on my IPad
but if I put:
Void disvar(int* a)
{
Int b=a;
Cout<<b<<endl;
}
So when I'm in the main I can put foo.disvar(foo.a) (if I remember right)
Of course you never put stuff like this in the main unless your writing kiddie scripts

If your interested in joining just reply
Also trumped by a 12 yr old.

rogueinc01
New Scratcher
8 posts

C++

Sorry for double post but guy who put edit obligatory hello world script, you forgot to return 0;

rogueinc01 wrote:

Hey, is anyone interested in joining my C++ study group, you would have to have Skype and the willingness to learn SDl and OpenGL, I'm writing on my IPad and it's 1 AM but in C++ programming when you get into classes and start to use private, public and protected things you can't use the above methods so they end up making functions just display something like this little code I made:
class A
{
Int a;
int b:
public:
int c;
Int d;
Int e;

void setvar()
Yada Yada


cout<<a<<endl;ERROR something like main can't access A.a, remember I'm on my IPad
but if I put:
Void disvar(int* a)
{
Int b=a;
Cout<<b<<endl;
}
So when I'm in the main I can put foo.disvar(foo.a) (if I remember right)
Of course you never put stuff like this in the main unless your writing kiddie scripts

If your interested in joining just reply
Also trumped by a 12 yr old.


edit: guy who put obligatory hello world script, you forgot to put return 0; which would have led to a memory leak in a more advanced code.
16Skittles
Scratcher
500+ posts

C++

rogueinc01 wrote:

Sorry for double post but guy who put edit obligatory hello world script, you forgot to return 0;

rogueinc01 wrote:

Hey, is anyone interested in joining my C++ study group, you would have to have Skype and the willingness to learn SDl and OpenGL, I'm writing on my IPad and it's 1 AM but in C++ programming when you get into classes and start to use private, public and protected things you can't use the above methods so they end up making functions just display something like this little code I made:
class A
{
Int a;
int b:
public:
int c;
Int d;
Int e;

void setvar()
Yada Yada


cout<<a<<endl;ERROR something like main can't access A.a, remember I'm on my IPad
but if I put:
Void disvar(int* a)
{
Int b=a;
Cout<<b<<endl;
}
So when I'm in the main I can put foo.disvar(foo.a) (if I remember right)
Of course you never put stuff like this in the main unless your writing kiddie scripts

If your interested in joining just reply
Also trumped by a 12 yr old.


edit: guy who put obligatory hello world script, you forgot to put return 0; which would have led to a memory leak in a more advanced code.
Will remember. I have seen it in code before, but never understood what it was for.
rogueinc01
New Scratcher
8 posts

C++

Sorry for that weird double post. I was using a proxy server which jammed up everything.

Powered by DjangoBB