LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 08: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, 09:49 AM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
what?
 
Old 07-07-2004, 10: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, 01: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



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 04:51 PM
Pure virtual function problem with G++ Darwish Programming 6 07-09-2005 08:06 AM
pure-ftpd and virtual servers mozilla Linux - Networking 1 05-03-2005 06:35 AM
pure ftp help virtual user creation Tinku Linux - General 2 10-10-2004 12:24 AM
pure-ftpd virtual users problem stofferthebest Linux - Networking 0 04-12-2004 03:59 AM

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

All times are GMT -5. The time now is 08:55 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
Open Source Consulting | Domain Registration