simple C++ project samples [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last month.
Improve this question
Im trying to learn OOP but I need to see some real case scenarios of using C++. For me, as a beginner in programming internet is too big and the book is too few examples. All I find on the source repositories are large projects or too few details.
Can you give me a link to some c++ projects which are good for beginners? It will be great if the samples have some details about good practices.
maybe some universities are hosting such projects or maybe you know a webpage with samples and contests about how to program in C++ and it is good for beginners.

I'd recommend starting at the C++ Language Tutorial. There are lots of good examples there, including a section on OOP.

If you want to learn OOP try looking at these lecture videos, they are fantastic for beginners its in Java but you shouldnt limit yourself to C++ as a learning platform.
http://www.youtube.com/watch?v=KkMDCCdjyW8

You can take a look at this C++ book: C++ Primer which has good practice exercises and there is also a Answer book for the exercise problems.

In addition to all the fabulous lectures / books, I'd encourage you to practice a few times. I enjoy using the bowling kata exercise for this. Technically, this is a refactoring exercise but it is quite fun and I believe effective.

I did a screencast of the bowling game in C++ earlier this week. You can watch it here:
http://www.cheezyworld.com/2011/01/12/bowling-game-in-c/

I've found such a sample project.
The problem is that it is documented well, but the documentation-language is German. There additionally are some classnames which are German etc. There also is no documentation like a class diagram included.
I've written that project some months ago to show a new apprentice some C++ and some object-oriented tasks. Hope its not too complex for your purposes.
This example is not perfect, but perhaps it is what you're searching or other users could get a better idea of what is questioned.
Download (Rapidshare.com)
PS: How should someone upload such things in the future? There are several source-files included (pastebin wouldn't be good for something like that). I wouldn't use Sourceforge for such a project. Is there something like a stackoverflow-attachment feature?

Related

How to learn Fortran. Problems? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have just got a job, starting in a months time which requires me to use fortran.
I have brought a couple of books, but they seem to lack any questions or problems and that is how i learn best.
I would like to know if you could recommend and books or websites that offer problems that i could practise with.
Thanks
I can recommend several, depending on your previous programming in general knowledge and Fortran specific knowledge.
For an absolute beginner (and don't take this in a negative context; it just means you're starting anew, and unlike someone who has a habit of some bad Fortran77 practices, you'll start with a clean mindset) I would definitely go with Chapman's Fortran 95/2003 for Scientists & Engineers. It is an excellent learning book, and although it has some drawbacks they're not important at this stage. It also has a plethora of examples useful in real life. It also emphasises good modern Fortran concepts and ideas (Fortran 90 and newer).
After it, or maybe instead of it, if you're looking for more of a reference book one cannot recommend enough one of the following:
- Metcalf, Reid and Cohen's Fortran 95/2003 Explained (btw, a new edition covering the latest Fortran standard is coming up in a few days) - a classical reference book. Some swear by it instead of Chapman's.
- The Fortran 2003 Handbook: The Complete Syntax, Features and Procedures by several authors; a standard reference book, dealing with the finer aspects of the language. Not important at this stage but just so you know it's there.
Apart from these, which I like to call "the big three", there are numerous tutorials, scriptas and handbooks all over the web (free) and on Amazon. Some links were given in here as well, so I won't repeat those. Also, your compiler is bound to have a good reference manual I don't know about the free g* ones, but all commercial ones do.)
Apart from that, you know you can always ask any question that comes to your mind in here, and on comp.lang.fortran (usenet group; google for a "Usenet client" or "newsclient" and check it out.). Some very(!) knowledgeable people lurk in there.
If you haven't already, install Linux and gcc on a home computer and begin to play with FORTRAN or Fortran. The command prompt syntax is gfortran filename.f which produces an executable file named a.out.
As for hints of what to experiment with, use previous answers to Stack Overflow questions, from simple to not-so-simple:
Hello world
the CONTINUE statement
variable scope
integer to string
procedures and functions
F90+ KIND explanation
i/o units
file reading
file writing and implied do loop
formatted output
passing variable array parameters
Legacy FORTRANisms
Back in the day, I had the book "Structured Fortran 77 for Engineers and Scientists". There are updated versions of this book that cover the newer Fortran standards.
My Vote goes for the classic McCracken Book
http://www.amazon.com/Guide-Fortran-Programming-Daniel-McCracken/dp/0471582816

GTKmm books for complete beginner? Do I need to learn GTK+ before GTKmm? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am familiar with C++ & OOP. I really want to develop a GUI for my program running on Linux using GTKmm. However, I could not find any good book or tutorial for GTKmm.
I have never done any GUI programming before. I did read the gtkmm tutorial on GTKmm homepage http://www.gtkmm.org/en/ but I couldn't understand the way labels, widgets, boxes, etc... were arranged and how to use those classes. I got confused right at the start of chapter 4.
Therefore, my questions are:
1. Does any one know a better GTKmm tutorial rather than the one on their homepage?
2. Does learning GTK+ first make learning GTKmm easier?
If you are focused on C++, I would stick with GTKmm and not bother with GTK+ C API for now. It's different enough and will probably just confuse you, especially if you do not have a strong C background.
Unfortunately, the 3rd-party documentation of GTKmm is a little lacking. Their tutorial book though I think is top-notch. I would cut/paste, then compile their sample programs. Examining the source is the best way to learn it. For example with Chapter 4 (Buttons), look at the example program here.
Be careful to follow the right tutorial for your version of GTK (GTK2.4 vs. GTK3.0). GTK3 (and GTKmm 3) was just released.
I would recommend to learn the C API first.
GTKmm does a lot of convenience magic that is nice to have but it also hides some details that you should understand. A lot of newbie problems are from memory management, floating and reference counting and destruction of objects.
This book is very good for beginners

Projects for C++ Beginner/Intermediate? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I really want to learn more about C++. I know the basics, and I know the concepts, and I have even been able to create C++ projects myself, but my problem is being able to view, fix, and add to code I haven't written myself. I have looked at some open source projects on sourceforge, etc, but many of them are so big or there are soooo many projects available until I don't know what to do.
Are there any "small or simple" projects or tasks in C++ that will allow me to extend my knowledge of C++ by use of hands on experience?
If you are already able to create own projects, I think the best way to learn how to read&change someone's code is to get job in software company. They even will pay for it :)
Creating your own client / server application using socket programming is a big and fun area in programming which you should check out.
http://subjects.ee.unsw.edu.au/tele3118/wk6_sockets.pdf
...but my problem is being able to
view, fix, and add to code I haven't
written myself.
That is tough even for experienced programmers.
A book that might help you is Code Reading: The Open Source Perspective by Diomidis Spinellis.
Read The Art of Unix Programming ( TAOUP ). Its available online, well written and has lots of case studies that represent well designed programs. You may also find some good C++ opensource software amongst those case studies.
Apart from TAOUP, take a look at Boost C++ Libraries. They provide peer reviewed source libraries that are very well documented.
Another one, I have heard is Postfix ( an Open source email server for Unix ) that is said to have well written C++ code. Though, I must admit I do not have any direct experience with it.
Hope this helps :)

i need a good website to learn c++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
i want to learn C++; and i already have a compiler.
i already know a few programming languages including:
BASIC (yes, the dos version)
visualBasic (using VisualBasic Express
2006 or 8 i'm not quite sure)
Java
PHP
HTML (if we count that)
so it doesn't need to be for absolute beginners; although if you find one post it too.
www.cplusplus.com is a great website with tons of documentation for experts and beginners.
Tutorials for beginners:
http://www.cplusplus.com/doc/tutorial/
An additional website I heartily reccomend once you have a little more expertise is the C++ FAQ Lite.
The text of a good book is online here: Thinking in C++
G'day,
I know it isn't a website but I'd highly recommend working through the excellent book Accelerated C++ (sanitised Amazon link) by Andy Koenig and Barbara Moo.
It'll start you off properly by approaching C++ as it's own language rather than C with OO bits "bolted on". And you get to work with STL right from the start.
Highly recommended.
HTH
cheers,
It's not a tutorial per-se but the C++ FAQ LITE is an invaluable resource IMHO.
I would like to highlight a website for C++ programming.
Learn C++ Online - www.learncpponline.com
The above website is still not completely updated I think. But this website helped me a lot in my studies. Hope it will be helpful for others as well
Aprt from the useful links given by #Doug T. You can have a look at the advanced puzzles of c++ # http://www.gotw.ca/gotw/ ( of course after the basics)
I second Rob Wells; "Accelerated C++" is an excellent book. It would be hard to do better.
I would like to add that pointers can be especially daunting coming from your background. One of the best explanations I have come across is here at the Stanford CS web site. They have several pdfs and even an animated video on the subject.

Any good advice on using emacs for C++ project? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for a good article on using emacs as C/C++ IDE.
Something like Steve Yegge's "Effective emacs".
No specific article, really, but I've found EmacsWiki to be full of useful information. Consider checking out these entries:
CPlusPlus as a starting point for many C++-related articles, and
CppTemplate to define a template that can give you a good skeleton when you start new files
I've recently stumbled upon this article which is quite good.
EDIT: Yep the link is no longer valid. It seems like they've changed their url recently and it doesn't redirect properly. Hopefully it will be back soon. Anyway the article was called "Benjamin Rutt's Emacs C development tips". I managed to find a copy here.
I'm planning to write such article in near future, but you can now take my configuration of Cedet + Emacs, that helps me to effectively edit C++ sources.
If you'll have questions, you could ask me directly
Be aware that Emacs' C++ mode is based on only regular expressions, not a grammar. Hence, the syntax highlighting is not based strictly on the syntax of the language itself, but rather is largely based on commonplace formatting. The Emacs syntax highlighting of C++ often makes mistakes.
The problem is not limited to syntax hightlighting. The same defective design applies to the automatic formatting. All this said, I have been using only Emacs for all of my editing of C++ source code for over 20 years, since the cfront days. (I usually turn off electric key bindings, because of Emacs' defective regex-based design. Regexes do not have enough expressive power to describe the C++ syntax accurately.
I recommend ggtags and irony-mode. Other then that you may want to use helm-ag to search ("grep") for strings in your codebase.