Suggestions for C++ project

K

Krypto

I have learned in C++ in a course one semester. I did small projects
related to data structures and algorithms, but I never wrote big
projects in C++, or in short do not have the confidence to drive a
medium sized project.

I know basic STL and C++. I will admit I never used inheritance,
dynamic binding, and templates in the small projects I did, though I
know how they work.

Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

One last question I will ask is about multithreading. I have never
used multithreading in C++. I did read some articles on web about
multithreading (it was in windows though). I have mainly used C++ on g+
+ compiler and never knew how multithreading works in C++. My question
is, Is multithreading platform (OS) dependent and if yes, can you
suggest some good resource for Linux and Windows for C++
multithreading.

Thanks for your time.
 
M

MiB

I have learned in C++ in a course one semester. [..]

Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

Find something useful for yourself or interesting because of other
hobbies.

* Do you collect something? - Write a book keeping software for your
stuff.
* You do some sports in a club? - How about a competition management
program or something to keep track of your personal training
improvement?
* You like strategy or puzzle games? - Write a program that can
solve a puzzle or beat you in your favorite 2-person game.

Put some effort into thinking about code re-usability and proper
documentation, you may find solutions for hobby projects useful for
professional work later.
One last question I will ask is about multithreading. [..]
My question
is, Is multithreading platform (OS) dependent and if yes, can you
suggest some good resource for Linux and Windows for C++
multithreading.

Multi-threading is not supported by C++ language directly. At its core
multi-threading is very platform dependent, but there are unifying
wrappers available. You may resort to library functions, like POSIX
threads (Pthreads) or if you do not mind platform lock-in, functions
from Windows API. The boost library also offers portable support
(boost/thread.hpp).
However, I prefer the OpenMP extension, available both to GCC and
Microsoft compilers. It follows a different approach to parallelism
than Pthreads, but I find it more intuitive (no flame wars here,
please, this is a matter of personal taste and your mileage may vary).

You'll find on-line documentation galore by asking aunty Google for
"OpenMP", "Pthreads" or "Boost Threads".

best,

MiB.
 
F

Francesco

I have learned in C++ in a course one semester. I did small projects
related to data structures and algorithms, but I never wrote big
projects in C++, or in short do not have the confidence to drive a
medium sized project.

I know basic STL and C++. I will admit I never used inheritance,
dynamic binding, and templates in the small projects I did, though I
know how they work.

Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

One last question I will ask is about multithreading. I have never
used multithreading in C++. I did read some articles on web about
multithreading (it was in windows though). I have mainly used C++ on g+
+ compiler and never knew how multithreading works in C++. My question
is, Is multithreading platform (OS) dependent and if yes, can you
suggest some good resource for Linux and Windows for C++
multithreading.

Thanks for your time.

Hi Krypto,
just to get your post upside-down: I've never faced multi-threading,
but it has a very high position on my to-do list - well, surely it
comes after "getting a firmer grasp on the basics" ;-)

About the rest of your post: one of the first "serious" features I
wanted to add in my C++ programs is a graphical interface. I did so
using SDL, which gives only very basic primitives like drawing a point
or a rectangle on the screen, or displaying a bitmap.

Creating simple widgets on top of it, like frames, buttons and
textboxes, led me to face some interesting issues about inheritance -
in my homemade simple GUI, for example, mouse events are passed
straight to the root widget (a frame that takes occupies all the
available screen) and are then dispatched from widget to the tree of
child widgets depending on different things like coordinates,
currently active widget (focus) and so on.

It helped me a lot to try out various approaches about arranging the
hierarchy of these widgets, also adding the possibility to create and
destroy these widgets at runtime is helping me getting a better grip
on polymorphisms.

Also creating different kinds of shapes - lines, ellipses and
polygons, for instance - led me to study different hierarchical
approaches and to face performance improvements like drawing things on
screen using integer instead of floating point variables during
calculations.

Well, just my two cents, hope this can help you get an inspiration for
your project.

Cheers,
Francesco
 
J

JustBoo

Francesco said:
Creating simple widgets on top of it, like frames, buttons and
textboxes, led me to face some interesting issues about inheritance -
in my homemade simple GUI, [...]
Well, just my two cents, hope this can help you get an inspiration for
your project.
Cheers,
Francesco

How’s this. You mentioned you're using a GUI. Build yourself (to
learn) a hand-crafted GUI-based "database" application. All with only
C++. It teaches many aspects of C++ programming. I'll use the classic
Audio CD/Record-Collection thingy as an example.

Research Comma Separated Value ( CSV ) files. Think of each row of a
text file as a row (record) in a database; like a spreadsheet. (I
would *not* use XML right now. Just use a plain text file.) Learn to
get a line in at a time and parse that line into usable variables.

Example:
cd_name, artist_name, category, [etc...]
------------------------------------------
"Led Zeppelin IV", "Led Zeppelin", "Soft Rock", [more if desired...]
Make as many rows as you want.

Now build a GUI app that will read the file in and save it out,
(iostreams).

Databases have 3 basic states, add a record, edit a record or delete a
record. Have your records display in a GUI list box with as many of
the fields shown as desired. Put buttons on the screen that will allow
the user to add records, edit records and delete records.

When the user clicks the Add or Edit buttons, you will have to display
another screen (sometimes called a form) that has textboxes where the
user can fill in the information to add or edit a record. Search for
the "list/view" design pattern for guidance. It's a good way to
"drill-down" in data. There should be "Save" and "Cancel" buttons as
well. Trap the Save button click-event and save out the file there.

I may have made it sound more complicated than need be, it's just a
GUI-based app that displays CSV text-based lists of "stuff" that you
can add, edit or delete information from, but you will use a lot of
the facilities of C++, IMO at least.

Let us know if you proceed.

HTH
 
J

Jorgen Grahn

I have learned in C++ in a course one semester. I did small projects
related to data structures and algorithms, but I never wrote big
projects in C++, or in short do not have the confidence to drive a
medium sized project.

I know basic STL and C++. I will admit I never used inheritance,
dynamic binding, and templates in the small projects I did, though I
know how they work.

Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

One last question I will ask is about multithreading. I have never
used multithreading in C++. [...]

You seem to have two conflicting goals: creating something worthwhile,
and using certain parts of C++. Might be better to decide what you want
to create, and use the parts of C++ which fit best.

Personally I congratulate myself when I *don't* have to use inheritance,
polymorphism or multithreading. Especially multithreading.

/Jorgen
 
R

Rune Allnor

Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

1) Decide what kinds of applications are important to you
(device drivers, GUI-based apps)
2) Find out what kinds of skills are useful for building
those sorts of apps
3) Come up with and example that exercise as many of those
skills as possible.

My own field of inteerst is high-volume off-line data
processing. My vocational training is on the core processing
parts, but those are just the core, accounting for maybe
10-15% of the total code. An actually useful application in
this area would need

- A database where to fetch data and store results
- A flexible job conficuration tool
- A real-time status / progress report tool
- Various interactive configuration and editing tools
- Data visualization and reporting tools

and so on. If I were to guide somebody who started out
in my field, I would suggest they came up with a project
that focused on some core interest (signal processing, GUI,
data visualization,...) but still touched on as many of the
other aspects as possible. It would require immense amounts
of time to cover all items well, but even rudimentary
experience with each is far better than no experience at all.

Rune
 
F

Francesco

Francesco said:
Creating simple widgets on top of it, like frames, buttons and
textboxes, led me to face some interesting issues about inheritance -
in my homemade simple GUI, [...]
Well, just my two cents, hope this can help you get an inspiration for
your project.
Cheers,
Francesco

How’s this. You mentioned you're using a GUI. Build yourself (to
learn) a hand-crafted GUI-based "database" application. All with only
C++. It teaches many aspects of C++ programming. I'll use the classic
Audio CD/Record-Collection thingy as an example.

Hi JustBoo,
I'm not sure about whether it's me who has mistaken your post or the
other way round - it was the OP who was looking for suggestions, not
me, although I take advantage and inspiration wherever I can.

Actually, I'm not simply using a GUI, I'm creating one on top of the
Simple DirectMedia Layer library (http://www.libsdl.org). Well, to be
more precise, I did it two years ago, one year after having started
learning C++. More about that here below.
Research Comma Separated Value ( CSV ) files. Think of each row of a
text file as a row (record) in a database; like a spreadsheet. (I
would *not* use XML right now. Just use a plain text file.) Learn to
get a line in at a time and parse that line into usable variables.

[details snipped]

I already dug those subjects. Actually, I've also created my own
binary formats, even back when I used only VB. One of my latest C++
projects involved parsing some table-formatted HTML files to harvest
their data, store it in a database file and output div-formatted HTML
files there on. This project is currently messed up - I've started it
as a single-source-file parser, but now I'm splitting it into
different TU because I'm about to add new features.

For curiosity's sake, I've set up a simple website to share a program
of mine - the only one that is somewhat complete and somewhat
interesting to use - I shared it elsewhere before, but that online
archive is not currently available.

This program is about the centers of a triangle and various other
entities related to them.
It can be found here: http://fscode.altervista.org
I've had a look to the source because I had to recompile it, and I
found several oddities and bad habits to fix. I think I'll rearrange
it to separate the GUI part and create a static library out of it, so
that I can reuse it - that's effectively the task I'm pursuing now,
I'm centralizing all the utilities I've created in these three years
and I'm revising all the code to correct it under the light of the new
things I learned.

Sorry for going so off-topic, feel free not to feed this branch of the
thread.

Best regards,
Francesco
 
C

Christof Donat

Hi,
Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

One last question I will ask is about multithreading. I have never
used multithreading in C++. I did read some articles on web about
multithreading (it was in windows though). I have mainly used C++ on g+
+ compiler and never knew how multithreading works in C++. My question
is, Is multithreading platform (OS) dependent and if yes, can you
suggest some good resource for Linux and Windows for C++
multithreading.

Looks like you are looking for something useful to do with Linux under the
hood. Maybe you can find something interesting here:

http://www.kde.org/getinvolved/development/

Well designed C++ code and many experianced developers around who can help
you.

Christof
 
R

Rui Maciel

Krypto said:
Could you please suggest me some small to medium sized project in C++
such that I can actually use the C++ concepts like inheritance,
polymorphism etc.

You could comb through sourceforge to find any project that fits your requirements, catch up on the source
code and volunteer to contribute some patches.

One last question I will ask is about multithreading. I have never
used multithreading in C++. I did read some articles on web about
multithreading (it was in windows though). I have mainly used C++ on g+
+ compiler and never knew how multithreading works in C++. My question
is, Is multithreading platform (OS) dependent and if yes, can you
suggest some good resource for Linux and Windows for C++
multithreading.

You simply can't go wrong with pthreads. I also suggest that you subscribe to comp.programming.threads and
post there all your questions regarding multi-threaded programming.


Rui Maciel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top