Struggling to learn.

Hi guys. I have no coding experience at all outside of a little bit of HTML and I've been trying to learn C++ as of about 4 days ago. I ordered Accelerated C++ based on some online reviews but I'm really struggling with it which is kind of surprising because I was able to pick up HTML really quick. I'm not sure if Accelerated C++ was the right place to start or not, or maybe i just need to put more time in and really focus on learning each chapter, I'm not sure, but does anyone have any advice for someone in my position? Is there a better book for me to start with or are there some online tutorials that could help me learn the basics a bit more?

Thanks.
This very website has a tutorial:
http://www.cplusplus.com/doc/tutorial/

What specific questions do you have/what specifically are you having trouble understanding?
Also, when you feel comfortable enough, try to tackle some of these tasks.
http://www.cplusplus.com/forum/articles/12974/
Jkaplan wrote:
which is kind of surprising because I was able to pick up HTML really quick

Not that surprising. HTML is super easy to pick up, and it isn't programming. It's formatting text.

The tutorial on this site is one of the best online. We also house easily the best documentation on the language. I recommend going through the tutorial here step by step. Don't rush anything right now. You need a solid foundation of the basics, so make sure you understand everything before moving on to the next tutorial. And we are always here to answer any questions you might have.

I assume you've written your Hello, World program already? Is there anything in particular you're having trouble understanding?
The reference on this site is actually a little bit lagging - http://en.cppreference.com/w/cpp has a really good C++ reference and it is a Wiki so it is constantly being updated.
I do tend to use cppreference often too. But it doesn't feel as polished as it does here.

Where exactly are we lagging, though?
A lot of C++11 stuff.
Hi JJ. Programming is tough for some people. I've heard people are born with the skills necessary to become a great programmer. The only thing I find necessary to program is a willingness to learn. It makes it a ton easier if you actually enjoy programming. If it's fun, then you will do it for hobby and always want to learn more. Think of programming like an art, because it is. There's always one facet or another that could be improved in your code, whether that be elegance or functionality. Make it a game, see how far you can push the bounds of your knowledge and create fun and interesting programs to start out with.

Also, The tutorial that is on this web-site is great: http://www.cplusplus.com/doc/tutorial/

Also a great free online book to learn C++ would be "Thinking in C++" second edition, by Bruce Eckel I believe.

Also, throughout learning I do suggest you attempt each one of the exercises that lynx referred to.

Anyways, good luck Jay.
Last edited on
Thanks for the quick responses, really appreciate it. I have written the hello world program and that was very straight forward and easy to understand. I would say that where things started to get a bit confusing is with while statements in chapter 3 of accelerated C++. Also there are lots of excise problems asking if something is a "working program" and I can never really answer it. I know it's explained in the chapters but how the formatting should be exactly isn't really sinking in super quickly, maybe its cause I'm doing much more reading than I am actually coding so thats part of the reason why I think tutorials might help. I feel like maybe if I do more very basic coding it could help me get the formatting down better since its kind of difficult to learn that stuff by just reading about it. Thanks for linking those references guys I will check them all out in a little bit.

It's just one of those things where reading the book I get whats going on and can understand the concepts, but if you asked me to code a program using the same concepts i couldn't do it, it makes sense when I read it but how to put it to use isn't sinking in and I think thats because I'm just not memorizing/learning the concepts well enough yet. I should probably just spend a lot of time trying to memorize each concept.

Much appreciated.
Last edited on
I found( Maybe a lot may disagree ), that while I was reading a book, if an idea popped in to my head and I 'thought' I could code it, then I would stop reading and try to code it.

I, myself, Find that I learn better by coding. Then if I have an error, by fixing that error, I'll remember it more, than just reading "Fix this error" in a book without trying any code for myself.
Jkaplan wrote:
I would say that where things started to get a bit confusing is with while statements in chapter 3
OK, let's start there. What's the first thing you're having trouble with or getting confused on?

As for the formatting, the formatting in code doesn't matter. You could write the hello world program like this:
1
2
3
4
5
6
7
8
9
10
11
int


main
(                    )     {cout

<<                   "Hello, world!"
                      << endl


;}
Of course it looks ugly and is hard to read, which is why it is important to use proper formatting.
Last edited on
closed account (Dy7SLyTq)
can you though? i thought you can only have string literals span across multiple lines and overly long loop/branch conditions
There's a reason we have to have semicolons after each statement.
closed account (Dy7SLyTq)
@Resident Biscuit: so am i right then?
Nope, sorry I wasn't clear. It's just going to read until it hits a semicolon, or some delimiter (parentheses, brackets, etc.). This is legal:

1
2
3
4
5
6
7
std::cout << "Some random text just to fill space.
              Man isn't NCIS cool? I'm enjoying some NCIS right now
while I eat pizza."



;


Did some testing, intellisense will throw a fit about it. But once you build it it stops whining.
closed account (Dy7SLyTq)
well like i said i knew you could do it with strings. i wasnt aware you could do it to everything
Ah yup, the compiler could care less.
closed account (Dy7SLyTq)
good to know. thanks rb and LB
Topic archived. No new replies allowed.