Solved

good C++ source code

Posted on 2000-03-30
7
235 Views
Last Modified: 2010-04-10
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
0
Comment
Question by:chulsoft
7 Comments
 
LVL 1

Expert Comment

by:cbeattie
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.

http://www.cuj.com/home/ 
0
 

Author Comment

by:chulsoft
ID: 2670894
sorry
I need more general type of codes
0
 

Author Comment

by:chulsoft
ID: 2670913
sorry
I need more general type of codes
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Expert Comment

by:cbeattie
ID: 2670938
Check out http://www.codeguru.com, under their C++ & MFC section.
0
 
LVL 4

Expert Comment

by:wylliker
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.


0
 
LVL 3

Accepted Solution

by:
ufolk123 earned 50 total points
ID: 2671831
For tutorials :
http://devcentral.iftech.com/learning/tutorials/subcpp.asp

For code samples :
Very powerful page :
http://www.softpanorama.org/Lang/cpp.shtml
Data strcuture codes in C++:
http://www.josuttis.com/cppcode/cppcode.html

Hope this helps
0
 
LVL 10

Expert Comment

by:RONSLOW
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.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

912 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now