0

Hello ladies and gents,

I was just wondering how you would implement this into C if it actually is possible, if not, how do you guys implement an equal way of dealing with this in C ?

For instance, if you would have classes like this in C++:

class Lightwave
{
	...
};

class Modeler : public Lightwave
{
	...
};

class Layout : public Lightwave
{
	...
};

int main()
{
	cout << "Press enter to exit.\n";;

	cin.ignore(cin.rdbuf()->in_avail() + 1);

	return 0;
}

Is it all done with structures then?

4
Contributors
4
Replies
5
Views
11 Years
Discussion Span
Last Post by Ancient Dragon
0

>I'd hate to see you give a link to heavy
The C++ standard would probably be categorized as heavy reading, so would any volume of Knuth.

0

yes, it can be similated in C with structures. Its not quite the same concept as inherentence, but pretty close. And c++ class methods are not tied to any specific instance of a class -- they are more like static c++ methods.

struct Lightwave
{
  // blabla
}


struct Modeler
{
  struct Lightware lw;
  // blabla
};
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.