Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 99,784 C++ Programmers for FREE! Ask your question and get quick answers from experts. There are 1,547 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



C tips for C++ programmer?

 
Reply to this topicStart new topic

C tips for C++ programmer?

Kristano Esperanta
post 8 Oct, 2007 - 03:44 AM
Post #1


New D.I.C Head

*
Joined: 8 Oct, 2007
Posts: 12


My Contributions


I'm interested in helping with an open-source project that takes only C, not C++, for contributions.

Could anyone help me with understanding the limitations of C, and what I can and can't (regardless of hours of googling) do in C? I understand the structure of both languages is somewhat similar, since, after all, C++ is a C derivative.

I'd really appreciate the help.
User is offlineProfile CardPM

Go to the top of the page


jjhaag
post 8 Oct, 2007 - 04:07 AM
Post #2


me editor am smartastic

Group Icon
Joined: 18 Sep, 2007
Posts: 1,789



Dream Kudos: 775

Expert In: C,C++

My Contributions


well, c is a procedural langauge, so the biggest limitation is that you can't take an object-oriented approach to programming with it, whereas c++ is all about OOP.

whether or not that is an actual limitation depends on what you're trying to do. what type of project is it? are you the type of programmer who wraps every last thing into a class, even if you are never going to reuse the class or create any derived classes from it? or do you do basically procedural programming with the occasional class where it's blatantly obvious that the program structure falls into the object-oriented paradigm?

personally, i find a lot of the dynamic memory allocation associated with c to have tedious syntax. i don't do a lot of strictly OOP work, so much of my code could be translated pretty easily into c. however, for some stuff, like numerical computation with matrices, the class/OOP paradigm makes things WAY easier on me.

don't know if that'll help you. you might want to be a little more specific with reference to what you're trying to do.

cheers,
-jjh
User is offlineProfile CardPM

Go to the top of the page

PennyBoki
post 8 Oct, 2007 - 04:26 AM
Post #3


system("revolution");

Group Icon
Joined: 11 Dec, 2006
Posts: 2,009



Thanked 1 times

Dream Kudos: 500

Expert In: Java,C++,C

My Contributions


QUOTE(jjhaag @ 8 Oct, 2007 - 04:07 AM) *

well, c is a procedural langauge, so the biggest limitation is that you can't take an object-oriented approach to programming with it, whereas c++ is all about OOP.

I have to disagree here jjhaag, since I'm not experienced programmer correct me if I'm wrong please. You can do OOP in C, however unpopular that may be. And C++ is not all about OOP, most of it sure I guess but not all of it. wink2.gif

Kristano Esperanta
Try to avoid OOP in C. Also what is your level.. If you know well C++ you will have no prob. with C.

and here few links hope you'll find them useful:

http://www.cprogramming.com/

http://www.geocities.com/vijoeyz/faq/


User is offlineProfile CardPM

Go to the top of the page

jjhaag
post 8 Oct, 2007 - 04:40 AM
Post #4


me editor am smartastic

Group Icon
Joined: 18 Sep, 2007
Posts: 1,789



Dream Kudos: 775

Expert In: C,C++

My Contributions


for both Kristano Esperanta and PennyBoki:

well, i'm here to try to help, but also to learn, so...cool. i've never seen oop in C, probably because i moved to c++ pretty quickly. PennyBoki, do happen to know of any examples of oop in pure c? i'd love to see some if you can find them; otherwise i'll try google.

and you are completely correct, c++ is not ALL about oop. object-oriented programming is merely one type of programming that it supports. however, it was designed with various aspects of oop as a goal, if my understanding of the evolution of the language is correct.

and, of course, as i alluded to in my previous post, i do mostly procedural programming, and i do it in c++. i use it because a number of features of the language are very convenient for what i do (especially the stl containers), and because i like it - it seems have better flow than pure c, at least in my mind.

-jjh
User is offlineProfile CardPM

Go to the top of the page

PennyBoki
post 8 Oct, 2007 - 04:48 AM
Post #5


system("revolution");

Group Icon
Joined: 11 Dec, 2006
Posts: 2,009



Thanked 1 times

Dream Kudos: 500

Expert In: Java,C++,C

My Contributions


You can check this book:
http://www.planetpdf.com/codecuts/pdfs/ooc.pdf

also check this link here:

http://ldeniau.web.cern.ch/ldeniau/html/oopc/oopc.html

As I said I'm not experienced programmer and certainly not that much to do OOP programs in C.
User is offlineProfile CardPM

Go to the top of the page

Kristano Esperanta
post 8 Oct, 2007 - 10:53 AM
Post #6


New D.I.C Head

*
Joined: 8 Oct, 2007
Posts: 12


My Contributions


The project I was interested in helping down the road is called "ReactOS." If you don't know what that is (you most likely do) it's an open-source Windows replacement, that is, it aims to recreate the entire Windows kernel and API and things from scratch.... no decompilation or otherwise illegal reverse-engineering. I am probably not a good enough programmer to be of real help yet, but the way I've always learned things is getting involved with something and not allowing myself to pull out until I understand it-- at which point I don't want to pull out, obviously. (Example: I started a project for my chess club, to keep track of their ratings system, when I didn't know anything about file I/O or how to sort data.)

C seems, as I thought, to be a completely different language from the C++ side of the fence. Maybe I should have learned C first, then C++... well, no matter, i'll just have to block C++ out and treat it like a brand new language!

This post has been edited by Kristano Esperanta: 8 Oct, 2007 - 10:58 AM
User is offlineProfile CardPM

Go to the top of the page

nirvanarupali
post 8 Oct, 2007 - 06:07 PM
Post #7


"To think is to create"

Group Icon
Joined: 1 Aug, 2007
Posts: 817



Thanked 1 times

Dream Kudos: 275
My Contributions


I can add up the discussion. C versus C++ smile.gif
User is offlineProfile CardPM

Go to the top of the page

coolannu00
post 11 Oct, 2007 - 04:52 AM
Post #8


New D.I.C Head

*
Joined: 7 Oct, 2007
Posts: 1


My Contributions


QUOTE(Kristano Esperanta @ 8 Oct, 2007 - 03:44 AM) *

I'm interested in helping with an open-source project that takes only C, not C++, for contributions.

Could anyone help me with understanding the limitations of C, and what I can and can't (regardless of hours of googling) do in C? I understand the structure of both languages is somewhat similar, since, after all, C++ is a C derivative.

I'd really appreciate the help.

u cant use classes in c which you can do in c++
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 7/25/08 01:21AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month
-->