Log in

View Full Version : Trying to Learn C++



StanTheMan
12-05-2011, 09:16 PM
I dont even know how to begin. What would be the most efficient compiler to use? I downloaded CodeBlocks that came with the GCC compiler, but I dont even know how to get to the compiler. Sorry for how vague this is, but im so lost I dont even know how to ask a question.

LiNuX
12-05-2011, 11:21 PM
How about Visual Studio? The Express version is free.

I actually have a few dozen C++ tutorials for beginners here: Easy Programming - C++ Tutorials for Beginners and More! EasyProgramming.net - Home (http://www.easyprogramming.net)

Total of 30 tutorials on the site but I have 2 more on my channel, haven't had the chance to update the site yet. And I don't have as much time to create new tutorials either. But I've gotten lots of comments and emails that the tutorials help. They're not perfect, but they might be of some help.

Also try cplusplus.com - The C++ Resources Network (http://www.cplusplus.com) - I go there for tons of resources and help when I get stuck.

Happy Learning!

Zombie47
12-06-2011, 02:16 AM
I wouldn't suggest you to use any IDE. I think you'll have a better understanding of how to use the language if you get into each step of creating a program.

I suggest you to download a compiler like MingGW (http://www.mingw.org/wiki/Getting_Started), in case you're using Windows. If you're using Linux, you probably have a C/C++ compiler at the ready. Write your code on a notepad or any ANSI text-editor, then compile the code by writing the commands yourself.

Initially, it might seem creepy and difficult, but once you know what's going on behind the scenes, you can use, control and modify any IDE as you wish, making the writing, compiling and deploying easier.

As Linux said, cplusplus.com is a great resource. I would add the C Programming (http://www.cprogramming.com/).

Hope this helps.

StanTheMan
12-06-2011, 06:42 PM
Turns out that I was trying to type into a script. Now that I've found where the commands actually go, everything has become so much simpler. I'm a little confused on strings though.

LiNuX
12-06-2011, 07:27 PM
Turns out that I was trying to type into a script. Now that I've found where the commands actually go, everything has become so much simpler. I'm a little confused on strings though.

What are you confused about? Or, what about strings confuse you?

StanTheMan
12-07-2011, 06:24 PM
This is part of the command that the tutorial was showing. I understand how/why string are used, but I was confused by 'mystring'. I don't know what it means or its use.

string mystring;
mystring = "This is the initial string content";
cout << mystring << endl;
mystring = "This is a different string content";
cout << mystring << endl;

LiNuX
12-07-2011, 06:49 PM
mystring is just the name of the variable, you can name it anything you want. You can even call it 'stantheman' and it'll work the same way. You can use just 'x' or 'y' and it'll work the same way.

Slay
12-07-2011, 07:09 PM
C doesn't seem so hard after learning Lua, I already know alot, I kinda quit as soon as I got to things that were harder like metatables, I might research some more, thanks to this thread.

StanTheMan
12-07-2011, 08:00 PM
Ok, this is starting to make much more sense now. Before I can use something, I must first declare what it is, its value, and then keep it constant throughout the process.

Zombie47
12-07-2011, 08:49 PM
Ok, this is starting to make much more sense now. Before I can use something, I must first declare what it is, its value, and then keep it constant throughout the process.

Just keep in mind that identifiers ( variables, functions, etc. ) must start with a letter and cannot be a reserved keyword (http://en.cppreference.com/w/cpp/keywords).


C doesn't seem so hard after learning Lua, I already know alot, I kinda quit as soon as I got to things that were harder like metatables, I might research some more, thanks to this thread.

After learning the first programming language, others will look easier. :)

forumhookers
12-24-2011, 02:41 PM
You have to be strong in pointers , thats important of all.

And learn what are all the datatype it has.

Exentenzed
12-24-2011, 05:54 PM
I found these very helpful.

Learn C++ (http://www.learncpp.com/)

TheGateKeeper
05-12-2012, 09:39 AM
For a development environment (IDE) you should use Visual Studio 2010. And as a side note, why are you going for c++ instead of c#? C# uses object oriented programming model and uses the .Net framework. This is what you should be looking into, instead of the now outdated c++.