Discuss Scratch
- christian2000
-
Scratcher
50 posts
C++
Talk about the super cool programming language here!
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
//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)
- 16Skittles
-
Scratcher
500+ posts
C++
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++
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-THow 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…}
- 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
whereas calling a function is
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.
For example to print is
cout <<"stuff";
object.function(parameters);
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++
I think that it's silly to have multiple ways of doing things when it could be done using a single style.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.
For example to print iswhereas calling a function iscout <<"stuff";Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.object.function(parameters);
I guess if I had started with C++ I might be more used to the syntax but I didn't.
- christian2000
-
Scratcher
50 posts
C++
#include <iostream>
using namespace std;
int main();
{
cout << “BUMP” << end;
}
using namespace std;
int main();
{
cout << “BUMP” << end;
}
Last edited by christian2000 (June 12, 2013 16:11:47)
- poopo
-
Scratcher
100+ posts
C++
Alright, excuse my lack of knowledge. >.< Still though, why do streams have their own syntax, why can't they just be objects?I think that it's silly to have multiple ways of doing things when it could be done using a single style.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.
For example to print iswhereas calling a function iscout <<"stuff";Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.object.function(parameters);
I guess if I had started with C++ I might be more used to the syntax but I didn't.
- GeonoTRON2000
-
Scratcher
100+ posts
C++
You'd like Java.Alright, excuse my lack of knowledge. >.< Still though, why do streams have their own syntax, why can't they just be objects?I think that it's silly to have multiple ways of doing things when it could be done using a single style.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.
For example to print iswhereas calling a function iscout <<"stuff";Maybe it's the fact that C++ is native but why couldn't printing be done using a function? Lots of other languages do.object.function(parameters);
I guess if I had started with C++ I might be more used to the syntax but I didn't.
- veggieman001
-
Scratcher
1000+ posts
C++
Nothing is permanent.
Last edited by veggieman001 (July 17, 2013 03:02:50)
- 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:
but if I put:
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.
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
Void disvar(int* a)
{
Int b=a;
Cout<<b<<endl;
}
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;
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.
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:but if I put: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 IPadSo when I'm in the main I can put foo.disvar(foo.a) (if I remember right)Void disvar(int* a)
{
Int b=a;
Cout<<b<<endl;
}
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++
Sorry for double post but guy who put edit obligatory hello world script, you forgot to return 0;Will remember. I have seen it in code before, but never understood what it was for.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:but if I put: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 IPadSo when I'm in the main I can put foo.disvar(foo.a) (if I remember right)Void disvar(int* a)
{
Int b=a;
Cout<<b<<endl;
}
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.
- rogueinc01
-
New Scratcher
8 posts
C++
Sorry for that weird double post. I was using a proxy server which jammed up everything.
