7 Replies - 1617 Views - Last Post: 11 October 2007 - 04:52 AM Rate Topic: -----

#1 Kristano Esperanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-October 07

C tips for C++ programmer?

Post icon  Posted 08 October 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.
Is This A Good Question/Topic? 0
  • +

Replies To: C tips for C++ programmer?

#2 jjhaag  Icon User is offline

  • me editor am smartastic
  • member icon

Reputation: 45
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: C tips for C++ programmer?

Posted 08 October 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.

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
Was This Post Helpful? 0
  • +
  • -

#3 PennyBoki  Icon User is offline

  • system("revolution");
  • member icon

Reputation: 53
  • View blog
  • Posts: 2,334
  • Joined: 11-December 06

Re: C tips for C++ programmer?

Posted 08 October 2007 - 04:26 AM

View Postjjhaag, on 8 Oct, 2007 - 04:07 AM, said:

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. ;)

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/
Was This Post Helpful? 0
  • +
  • -

#4 jjhaag  Icon User is offline

  • me editor am smartastic
  • member icon

Reputation: 45
  • View blog
  • Posts: 1,789
  • Joined: 18-September 07

Re: C tips for C++ programmer?

Posted 08 October 2007 - 04:40 AM

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
Was This Post Helpful? 0
  • +
  • -

#5 PennyBoki  Icon User is offline

  • system("revolution");
  • member icon

Reputation: 53
  • View blog
  • Posts: 2,334
  • Joined: 11-December 06

Re: C tips for C++ programmer?

Posted 08 October 2007 - 04:48 AM

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

also check this link here:

http://ldeniau.web.c.../oopc/oopc.html

As I said I'm not experienced programmer and certainly not that much to do OOP programs in C.
Was This Post Helpful? 0
  • +
  • -

#6 Kristano Esperanta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 08-October 07

Re: C tips for C++ programmer?

Posted 08 October 2007 - 10:53 AM

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: 08 October 2007 - 10:58 AM

Was This Post Helpful? 0
  • +
  • -

#7 nirvanarupali  Icon User is offline

  • D.I.C Stomach
  • member icon

Reputation: 13
  • View blog
  • Posts: 1,119
  • Joined: 01-August 07

Re: C tips for C++ programmer?

Posted 08 October 2007 - 06:07 PM

I can add up the discussion. C versus C++ :)
Was This Post Helpful? 0
  • +
  • -

#8 coolannu00  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-October 07

Re: C tips for C++ programmer?

Posted 11 October 2007 - 04:52 AM

View PostKristano Esperanta, on 8 Oct, 2007 - 03:44 AM, said:

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++
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1