Like Tree1Likes
  • 1 Post By grumpy

Is it possible function overrriding in c?

This is a discussion on Is it possible function overrriding in c? within the C Programming forums, part of the General Programming Boards category; I know that c++ supports function overriding . But we can do function overriding in c also? I fell that ...

  1. #1
    kotin
    Join Date
    Oct 2009
    Posts
    132

    Is it possible function overrriding in c?

    I know that c++ supports function overriding . But we can do function overriding in c also?

    I fell that its not possible in C. Can any one give your comments on this?

    Thanks in advance.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,275
    It is not natively possible in C, but as a matter of course when fully simulating OOP in C, it can be done, e.g., by implementing a virtual function table.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,646
    No, it is not possible.

    Quite a few people confuse the concepts of function overriding and function overloading. However, regardless of which one you have in mind, C supports neither.

    It is possible to simulate the behaviours, but the capabilities are not native to C.
    stahta01 likes this.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 06-09-2009, 03:19 AM
  2. Print function: sending a function.. through a function?
    By scarlet00014 in forum C Programming
    Replies: 3
    Last Post: 11-05-2008, 05:03 PM
  3. Replies: 14
    Last Post: 03-02-2008, 01:27 PM
  4. Replies: 9
    Last Post: 01-02-2007, 04:22 PM
  5. Overrriding
    By siavoshkc in forum C# Programming
    Replies: 3
    Last Post: 10-07-2006, 12:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21