I am 12 and want to learn C++

Just what the title says. I spend about a month learning the basics of C++ but then got stuck on function (class). If anyone could explain that would be great.
Also, what is a good C++ compiler for windows 7 home premium 64 bit? Thanks.
Last edited on
As for learning, there are tons of stuff up on youtube if you're a visual person. If not, just try to get the basics from there then just go out on your own a start a small project and slowly build new thing into it as you learn them from the internet.

As for a compiler, Visual Studios works nicely if you can get your hands on it.

As for classes, expand on where you're confused. Do you understand Structures yet? If not start with those.
Last edited on
I use Code::Blocks my young friend. There are a ton of free c++ compilers out there. Code::Blocks is a solid performer as far as Im concerned. Ive written tons of programs with it. It also comes with a good IDE. Fairly easy to use.

Your question is about functions? I was curious as to why you put (class) after it.

As Sanity stated, Dev-C++ is also very good. I will have to disagree with my friend Sanity on the subject of starting with C. Back in the early 90s, my first language I learned was C++. Yo can go any route you wish. C, C++. Its all good.
Last edited on
If you're still new to programming, it's generally best to first learn C,


I've heard good things about Dev-C++ from bloodshed.


Advice to ignore.
I don't agree with the "learn C first" policy.

C is a simpler language syntactically, but is a much more difficult language conceptually because it immediately forces you into very low level concepts. Higher level languages are typically better to learn the basics of programming from... then once you get a grip on the basics you can learn about the more complex lower level details exposed in languages like C and C++.


Right out I will say that C or C++ are both very difficult languages and probably not the best first language to learn. That doesn't mean it's impossible to learn them first (I learned C++ as my first language and I turned out pretty well), but it's probably not the easiest route to go.

An extremely high level language like Python is probably a good intro language. Once you get an idea of how programming works from dinking around in Python, then you'll have a much easier time diving into a more complex language like C++.



But that's just my opinion. I've heard other people say the exact opposite.. that people should start low level (assembly) and work their way up. Personally I think that's insane, though.
Advice to ignore.


I've never used Dev-C++ myself, I just have heard of it from quite a few places so assumed it was good, my appologies and that's removed.

As for not learning some C before C++, why is that not recommended?
As for not learning some C before C++, why is that not recommended?


C and C++ are different languages that require different approaches to program in effectively, so one may as well begin with an approach more suitable to C++ and the paradigms it supports.
Last edited on
@Disch
I don't agree with the "learn C first" policy.

C is a simpler language syntactically, but is a much more difficult language conceptually because it immediately forces you into very low level concepts


I would not say that C is more difficult language than C++. Quite the contrary C is simpler than C++ because most of programmers do not understand OOP and think that using OOP syntaxic constructions is the OOP itself. You can write OOP programs in C because OOP is not some set of syntaxic language constructions. It is some general approach to writing programs.
But in any case there is no necessity to learn at first C because as correctly mentioned @cire C and C++ are two different languages though have many in common.
Last edited on
Writing OOP is more difficult, yes. But using OOP is not.

Compare using std::string and std::vector vs. using char arrays and mallocing your own arrays.

C++ is multiparadigm so you don't have to write OOP code with it. You can write a procedural program (and in fact, that's a very good way to start with the language). But while doing so, you can take advantage of OOP by using pre-made classes, both in the standard library and in other external libraries. That makes it much eaiser to start doing more advanced things more quickly.
you are 12 years old and want to learning C++, nice
i'm 18 and now studying c++ got many stuck, good luck! ^^
I'm using http://www.bloodshed.net/ to learn and make console apps.

I have not had any problems with it on XP or windows 7, other than learning C++ and sometimes the strange error messages I get :) which are from my programming errors not the app.
Hi why won't this compile? Thanks.



#include <iostream>

using namespace std;

int main()
{


cout << "What is your age?" ;
cin >> "age";
return 0;
}
cin >> "age"

You are trying to input data from the keyboard and store it in "age". This is nonsensical. If you want to store some data, make a variable to store it in.

For example, here is how to store some input data in a variable:
1
2
int x;
cin >> x;
to explain what Moschops says above,
cause I was also confused in the beginning,

you are trying to input an integer into this "age" but right now,
it doesn't exist in your program.

you have to first declare it....
ex.

#include <iostream>
using namespace std;
int main()
{
int age; //declared the input data called age

cout << "what is your age?"; //prompt user for their age
cin >> age; //input the age into a declared data
cout << "you are " << age << " years old." << endl; //use the input data and call out

return 0;
}

something like that
you will be good at this in no time, things seem tough at first but they get easy and then you come across the next thing and then its hard but that clears up too and so on...i heard theres a lot of finding new stuff to learn at all times though, which is also great.

your good at something when you are better than everyone else XD

the only way to be better than everyone else at something is to start young and keep practicing...i have regrets about not sticking to learning the same thing and practicing regularly guitar basketball programming you name it shud have stuck with it
Last edited on
closed account (EAUX92yv)
Dev C++ is and outdated and buggy compiler. I wouldn't suggest using it. Microsoft Visual C++ 2010 Express is a good free compiler. It's only disadvantage is that it can't be used commercially, but that's okay.
I learned quite a bit from this thread. xD Thanks.

Sadly I have to admit about 95% of my programming skill comes from school. I wish I had the ambition as a child to get a nice foundation in it on my own. And schools will always teach you the simpler languages first; they teach you C then build that into C++, really making it seem like it's just a more advanced version of it (I however learned java first). And after taking 1.5 years of java then having to sit through Visual Basic (where the program did all the work), I think I can see how starting complex and working toward the simple is effective. <3's

e/ Ya, and my info on Dev C++ was from a couple years ago. I've never used anything outside of Textpad and VS, and textpad is just meh.
Last edited on
goto youtube.com
@magiccode We tend to strongly discourage the use of the goto statement.
Feel free to ignore this if you already know about it, but if you use google chrome, you might want to take a look at sourceLair. With sourceLair, you don't even have to install anything- you can just run things from your browser. I've been fooling around with it this morning, and I'm pretty impressed. Of course, I'm a first semester CS student, so I'm easily impressed. Still though, if you're looking for something super easy to get started with, that might be just what you're looking for. Good luck!
Topic archived. No new replies allowed.