I need some pointers

Pages: 12
Hi.

I've been trying to get into C++, but I've not found a proper(for me) source of learning.

I have tried www.learncpp.com, a book by Bjarne Stroustrup, a school book, but I've given up each time.

I have prior programming experience, for years I've programmed in PHP/C#, lately I've picked up Lua for some side projects.

In C# I was working in XNA, but after hearing that Microsoft no longer supports XNA, I started thinking about C++. I found out about MonoGames which is basically XNA being developed by not Microsoft, it felt unreliable knowing that it might aswell stop being developed. So now I want to learn C++.

I've read the basics of C++ in the three learning sources I have, defining variables, loops etc but nothing advanced like pointers etc (I don't even know what it means).

What I'm looking for is an up to date book, ebook, or website, that actually teaches you from the basics(not "how to define a variable" basic, more basic enough so that someone with prior programming experience can get right into it). From my current learning sources I've always given up because I never get anywhere with it. I'd spend, lets say, a month, reading a 1000 pages book by Bjarne Stroustrup, which would probably give me alot of knowledge - but without having done examples on the way and actually made some stuff, I wouldn't know how to use it or what to do with it.

What I'm looking for, again, is a book with these examples and "learn by doing". My goal is to in the end be able to develop games which I was doing in C# XNA, but I understand that this is far out of the reach for a C++ beginner. I want to work professionally with game development in C++, so I'm ready to put years into this, as long as I see progress, starting off with some basic console applications, then in some way useful applications, graphical applications and in the end some game development. I get bored from just doing "add new item > cpp source file > write example code > run > exlude from project > repeat". I want to have a project to work on occasionally, using my knowledge. It may be expected that I do this from the knowledge I have, but that doesn't work for me. When I started off in C# XNA, it was straight to the point(but then I had C# knowledge already), and I started off making a game after reading the e-book, and I was happy with it. I basically want to do the same with C++, but not a game as first project of course. But, after finishing my learning source I'd like to have some projects that actually run and are useful, not just running that shows different example codes, like currently my C++ folder contains the basics of printing to the console, reading, loops, if/else, concatenation, data types etc (this is where my C++ knowledge ends). I've looked over all my three learning sources and none of them actually makes you do something useful, it's just a hundred cpp files filled with short code of how stuff works. I'm fine with doing that, but I'd also like to have a couple of files that I've put time into making, debugging, learning, to finally get to run as desired. Once again, I don't do well when I'm supposed to come up with what I want by myself, as then I might not know what I'm required to know to create it, I'll go trying to find it on the internet and I'll end up lost there. I want a book that, when finished, has helped me create something useful. As I said, I'm in the end looking for to be a game developer, but I understand that I'm far away from reaching there, but I'm willing to go there aslong as I have a good start so I can learn and improve by what I've done previously, so I'm not supposed to create something that actually is useful without having learned how to do so.

Thank you for reading.
Last edited on
You should move this thread to the Lounge.
You move a thread by clicking the Edit button of the first post, then select a new subforum.

Honestly, I don't have the patience to read the wall of text you wrote, and may this be a lesson to you: people in general are more lazy than you think.

Always try to simplify and shorten your post, or at the very least split it into paragraphs.

Here are sites that will help you get a grip on C++:

http://www.cplusplus.com/doc/tutorial/
http://www.cplusplus.com/reference/
http://en.cppreference.com/w/
http://www.icce.rug.nl/documents/cplusplus/
http://www.parashift.com/c++-faq/
http://c-faq.com/
What I'm looking for is a site, book or ebook that will teach me, who has prior programming experience from other languages, C++ with the "learning by doing" idea, with projects on the way.

I've tried cplusplus.com but it's not the way I want to learn.
Last edited on
@Catfish666
I read the wall of text and I'm the laziest person I know.

@Busan1
I'm a little concerned. You said you programmed in C# and PHP for years, but C# has pointers like C++ does. I think C# and C++ are similar in a lot of ways and is recommended to learn C# or Java before C++. Bjarne's books can be technically heavy but his are more reference books than learning books.

The only two books I see recommended lately is Accelerated C++, C++ Primer (NOT C++ Primer Plus), and recently Jump Into C++ written by the CProgramming.com webmaster Alex Allain.
@BHX Specter
Thank you for your reply, well - I mainly focused on XNA in C# on and off, it was never my main language (PHP is) but I have spent quite some time in C# but I've never used any pointers - again, after some time in regular C# and making some useful(for me) programs, I started with XNA as that's what I've always wanted to do. I'll have a look at those two books - thanks again.
goto library and read some different books to see which ones suit your style of learning. Of course, this only works if you have a nearby and reasonably decent library...


@Mats, there's a high chance they'll be outdated I'd think. I can order a book or if there's an ebook that suits my learning style, I'd do it - but it's hard to tell, all books claim they're the best.
My local library keeps reasonably up to date on programming books, especially with popular languages like C++.
I live in Sweden and last time I was there looking for programming books it seemed quite outdated and most books were swedish, I think it's a better choice to order a book online which is up to date and has good reviews.
closed account (N36fSL3A)
Oh, I have a null pointer if you'd like it.
0x00000

Anyways I'd say that you should just follow up on some web tutorials, I like them better than books. What type of things are you actually looking for?
Last edited on
@Lumpkin
I'm looking for a book or website that will teach me from the ground to being able to create stuff in C++ by myself. I will use other sources aswell, but I want a site to follow until I feel comfortable getting information from other sources. I want the learning source to go by "learning by doing", like all through the book, applying the new knowledge after each chapter, to a project, which is finished in the end of the book. I don't feel that I learn as much if, when the book is finished, all I got is 100 files that contain a few lines of code to show how different stuff works. I want to actually put it to use, which I feel most comfortable doing in a book.

Like, my first C# book was like this. I don't remember the name now, but it started with creating some files just to try stuff like printing to console etc etc, then after each chapter, it told you to create something with what you learned.

Like, after reading the first chapter, iirc - I was to create a 'machine' that returns the right amount of change. So if the machine took a 100 bill and something cost 6 then it should return 10 x 10 coins and 4 x 1 coins. This is a great way to learn in my opinion, compared to just jumping into the next chapter without having put your new knowledge to use.
Last edited on
Lumpkin wrote:
Anyways I'd say that you should just follow up on some web tutorials, I like them better than books. What type of things are you actually looking for?

Those are fine for refreshers, but tutorials don't cover as much as books do and any good tutorial will be honest and tell you that up front. Books have a larger wealth of knowledge and gets more technical.

@Busan1
Have you looked at the tutorials on this site? I still say look for a book, but see if some tutorials are clear. Though, books are way more technical than Learncpp.com and I don't know if you will be able to find a good book that does what you want.
@BHX Specter
I haven't looked at tutorials here, I will - thank you, currently looking around for a book.
It's fine for me if there's technical stuff, aslong as I actually get to use it.
Before I started this thread, I read a school book on C++, what got me bored today was reading that the 23rd file I was supposed to create was just:
cout << "datatype bool takes " << sizeof( bool ) << '\n';
for bool, char, short, int, long, float, double, long double.

Sure, it's good to learn - but I don't get to use it. 2 pages further and it's CHAR_MIN, CHAR_MAX and so on for the datatypes. 2 more pages and it's about how many digits the datatypes can hold. And after reading those six pages, I've made three new files for these that I most likely won't have any use for.

I'm fine with learning this, I understand that to become a good programmer I need to, but - I want to enjoy programming, which I don't if there's just theory and no productivity. I want to find a book which covers technical stuff, aswell as teaching you how to use your knowledge, when it's a good time to use it, instead of just printing the datatype size in the console, maybe put it in as a part of a program, to learn where it'd be useful to have it and what function it fills.

It might sound like I'm talking against myself with what I'm writing, and to be honest, I'm not exactly sure. I want to learn by doing and not only by reading.

I want it to be fun and I want to see progress while I'm learning, until I've learned enough to be able to create some basic stuff without having to read somewhere, and then from there I continue with a new learning source.
Busan1 wrote:
I want it to be fun and I want to see progress while I'm learning, until I've learned enough to be able to create some basic stuff without having to read somewhere, and then from there I continue with a new learning source.

Then you are going to be disappointed because I've been programing for 19 years I still find myself referencing basic things like getline(). Even the best programmers look up things because you won't use or remember everything, it just isn't possible. You have to find fun ways to implement what you learn. The learning form a book is never fun, but the fun comes into thinking of something to do that integrates what you learn. As for the sizeof(<data type>) is important because different systems give different sizes. Usually int is 4 bytes, but some of the types may vary.

Even now, I am doing the exercises at the end of each chapter of the Practical C++ Programming book and other books. Also working on some personal projects.
@BHX Specter

Thank you, I understand that this is required and I do that aswell for basic stuff in the languages I know, which isn't a problem for me, but, I feel that if I'm going to get somewhere with C++, I need to have a learning source to follow that will teach but also let me use what I've learned. I can't think of a program myself that I know I have knowledge enough to create in C++, except for the stuff I've already done - few lines of code to show an example of how the chapter stuff works. If the learning source would let me create something through the book, and apply my knowledge to a situation where the code I write is actually used, like, in the end having created a text based game, or a simple application to do something on your computer - then I'd be satisfied. I'm considering ordering the Accelerated C++ book atm, I'm just trying to find some more information about the content inside.
Accelerated C++ is a good book, but you may also want to look into getting the Ebook of Jump into C++ that was written by the CProgramming.com webmaster because it is like $20 last I knew (if you have a Kindle or such device).
I don't have Kindle but I can read it on my computer, I'll probably go for the ebook, I'll post back once I've decided.
I've ordered the ebook and I'll start reading soon and I'll report back in a while how it went!
I need some
pointers

0xfa134e6428
0x53c67c1974
0x32672026ab ...

:D
I almost did that joke, but then read the post and figured it was ill timed for a serious question.

[EDIT]
@Busan1
Definitely be sure to keep updated on if it helped or not.
Last edited on
Pages: 12