Re: As a programmer of both languages...
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Wed, 12 Dec 2007 23:30:23 +1300
jacob navia wrote:
I think I see your conceptual problem, do you claim that
struct A {
int age;
char *Name;
};
int main(void)
{
A jacob;
}
This is valid C++ but invalid C. In C++ each "structure" definition
is just a CLASS where all members are PUBLIC by default. I see this
explanation in all C++ books I read but in my ignorance I believe
them. Stupid isn't it?
class A {
public:
int age;
char *Name;
};
Is OO while
struct A {
int age;
char *Name;
};
isn't?
You appear to be confusing the use of structures with object orientation.
One can choose to write OO code in C or in C++. The choice depends of
the nature of the problem. One of the cleanest OO designs I have seen
is the old OpenView GUI toolkit, a textbook example of OO C.
--
Ian Collins.
.
- References:
- As a programmer of both languages...
- From: Tomás Ó hÉilidhe
- Re: As a programmer of both languages...
- From: jacob navia
- Re: As a programmer of both languages...
- From: Ian Collins
- Re: As a programmer of both languages...
- From: jacob navia
- Re: As a programmer of both languages...
- From: Ian Collins
- Re: As a programmer of both languages...
- From: jacob navia
- As a programmer of both languages...
- Prev by Date: Re: As a programmer of both languages...
- Next by Date: Re: C89: Compile-time constant required for initialiser?
- Previous by thread: Re: As a programmer of both languages...
- Next by thread: Re: As a programmer of both languages...
- Index(es):
Relevant Pages
|