Jump to content
  • Advertisement
Sign in to follow this  
stein102

c++ code examples

This topic is 1877 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm transitioning from Java to C++ and I'm finding the process of going through a book very tedious. Would it be a good idea to look over code examples and just see if I can figure out what's going on there as opposed to finishing this book? (Accelerated c++).

 

Also, can anyone provide some decent C++ code examples?

Share this post


Link to post
Share on other sites
Advertisement

I have done this and found most of it quite easy to understand. Most of its the same if written different and the few things that are brand new can be easily looked up. I have done lots of java but only basic C++ but I can still read through programs and understand whats happening so it does help.

Share this post


Link to post
Share on other sites
What level of C++ are you looking for?

Relatively simple C++ can be found all over the web in open-source projects. If you can read chunks of code from arbitrary C++ open-source code bases, and have a decent idea of what's going on, you're doing fine.

There's also stuff like Boost which is C++ but highly advanced in most cases and probably not something you're doing to encounter often.

Share this post


Link to post
Share on other sites

Well, it's still fairly basic, I'm not extremely far into the book(Haven't had a ton of time to work on it). My goal is to transition from Java into C++ and be writing the same level code as quickly as possible. Any tips?

Share this post


Link to post
Share on other sites

Write code. Lots of it. Use the book as a reference if all else fails, or (preferably) just look it up online.

 

Any suggestion on things to write? I always have a hard time thinking of good programs to write with good learning value

 

Also, is the tutorial at cplusplus.com any good?

Edited by stein102

Share this post


Link to post
Share on other sites

I would say if you are starting out anything and everything has good learning value because you are trying new things. So why not start with a simple game like tic-tac-toe or hangman and then expand on it to use new programming concepts as you learn them.

Share this post


Link to post
Share on other sites
"Good learning value" is not something you're really in a position to gauge accurately, frankly. You should write anything and everything you can think of, whether you immediately recognize its value or not.


Have a pesky problem that you're solving by hand? Automate it. Doing boring busy work in real life? Automate it. Have a game you enjoy playing that might be fun to reimplement (even if just a barebones clone)? Do it.

Share this post


Link to post
Share on other sites

cplusplus.com is rife with errors and misinformations. I'd stick to another site, until you are good enough to spot an error in their code before wondering why not only does their example not work, but their specifications are missing or impossible.

 

I've tried emailing in corrections, but he didn't quite get what I was saying; he kept replying with a description of what the functions are supposed to do, despite me telling him that his example function does not do that at all.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!