Link to home
Start Free TrialLog in
Avatar of chulsoft
chulsoft

asked on

good C++ source code

Hi!
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.

Criteria:
- 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
Avatar of cbeattie
cbeattie

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.

http://www.cuj.com/home/ 
Avatar of chulsoft

ASKER

sorry
I need more general type of codes
sorry
I need more general type of codes
Check out http://www.codeguru.com, under their C++ & MFC section.
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.


ASKER CERTIFIED SOLUTION
Avatar of ufolk123
ufolk123

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
software design patterns implemented in C++ are a good source of good code.  the source for stl is also pretty good C++ coding.