good C++ source code

Posted on 2000-03-30
Medium Priority
Last Modified: 2010-04-10
I'm trying to learn C++
I think the best way to learn a new language is learning from a good example.
Does anyone know a site that has a good C++ source code?
What I want to see is how to code in
OOP method.

- Strictly C++ (no Win32 programming)
- Intermediate to Advanced
- Good style (no Spaghetti coding like I see in some sites)
- Good use of OOP
- Preferably around 1000 lines of code

Thanks much
Question by:chulsoft
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 2670195
The C/C++ User's Journal is an excellent resource for example code.  Just go to their home page below and click on the "Code" link on the left hand side.  You can then download code from their current issue and from archives.


Author Comment

ID: 2670894
I need more general type of codes

Author Comment

ID: 2670913
I need more general type of codes
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 2670938
Check out http://www.codeguru.com, under their C++ & MFC section.

Expert Comment

ID: 2671797
Just my two cents ...

While sample code will get you something to look at - C++ can be rather challenging at times and you won't necessarily find all that you need to know from sample, especially - WHY - a program was coded a particular way.  What problem was the code trying to solve? Does the design support the requirements? What were those requirements?  All you really are looking at is an implementation.

Generally the best samples are small snippets that illustrate a concept or those that can be grown upon in stages to re-enforce previous concepts and illustrate higher level concepts.

There are just so many implementation options (and gotchas!!!) to be aware of, especially if working on a large complex system.

You might consider the following books to go along with your sample code browsing:
(I recommend these to all developers new to C++ at our IT shop)

O'Reilly Associates has a fairly good introductory book - C++ The Core Language - Gregory Satir and Doug Brown

To learn more about the do's and don'ts - and more importantly why - I recommend:

Effective C++ - Scott Meyers
More Effective C++ - Scott Meyers

And to understand the language as it was designed, the trade-offs made (and the issues behind them - there is no better source than from the horse's mouth

The Annotated C++ Reference Manual - Bjarne Stroustrup

To each their own, but I find C++ to be much easier to digest if taken in small bites and chewed well otherwise it can lead to painful indigestion or ulcers and if you don't wait to digest before diving in it could lead to drowning.


Accepted Solution

ufolk123 earned 150 total points
ID: 2671831
For tutorials :

For code samples :
Very powerful page :
Data strcuture codes in C++:

Hope this helps
LVL 10

Expert Comment

ID: 2672806
software design patterns implemented in C++ are a good source of good code.  the source for stl is also pretty good C++ coding.


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question