LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-07-2004, 09:08 AM   #1
LuderForChrist
Member
 
Registered: Jun 2004
Posts: 37

Rep: Reputation: 15
Pure Virtual


For those of who who have read/help out in my past thread, the C++ to C conversion is going great. But another challenge has arose!

I have a few firtual and many pure virtual functions in my C++ code.

Once I deleted the class and those functions in the public are open... can I just #include the file where the functions are declaired?

Once again thanks guys (and gals) !
 
Old 07-07-2004, 10:49 AM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
what?
 
Old 07-07-2004, 11:54 AM   #3
LuderForChrist
Member
 
Registered: Jun 2004
Posts: 37

Original Poster
Rep: Reputation: 15
Is there pure virtuals in C? If not (which I'm pretty sure I cant have them) how do I convert C++ pure virtuals and virtual functions to C functions?
 
Old 07-07-2004, 02:38 PM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
no. C does not support classes. you can mimic the OOP idea by using structures and function points, ie:
Code:
struct foo {
    int (*foo_bar)(struct foo *);
    void (*foo_hoo)(struct foo *);
    int data;
    char *name;
....
};

struct foo bar;

   bar.data = 20;
   bar.name = "bla";
   bar.foo_hoo(&bar);
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't enable virtual users on pure-ftpd G-Fox Linux - Networking 1 03-25-2010 05:51 PM
Pure virtual function problem with G++ Darwish Programming 6 07-09-2005 09:06 AM
pure-ftpd and virtual servers mozilla Linux - Networking 1 05-03-2005 07:35 AM
pure ftp help virtual user creation Tinku Linux - General 2 10-10-2004 01:24 AM
pure-ftpd virtual users problem stofferthebest Linux - Networking 0 04-12-2004 04:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration