Tony Johansson said:
Hello!
A friend of mine asked me the following question that is quite difficult to
answer.
For whom? ;-)
He use only C and can't find any problem with it.
Which problem is there when not using an OOP in solving problem compare to
when you using one OOP.
Well, C and C++ are both general programming languages - anything you can do in one you can do in the other.
There are arguably some programming tasks which seem particularly suited to the OO paradigm; event-driven programming
(as in GUI's or games, for example) comes to mind. There are, equally, programming tasks for which OOP is likely to be
pretty pointless - sequential number-crunching scientific applications, for instance.
Also, be aware that C++ doesn't *enforce* OOP; it facilitates it. Likewise, C doesn't preclude OOP, but nor does it
particularly encourage it.
To give an example, I write mostly (non-GUI) scientific apps. I use C++, although most of the time I find myself using
very few of the OO features of the language (I can hardly remember when I last coded a virtual function). I could just
as well use C - the main reason I don't is because of other appealing aspects of C++ such as neater I/O, generic
programming (templates) and containers.
You choose your programming language/programming paradigm according to the task.
HTH,