Re: As a programmer of both languages...
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Wed, 12 Dec 2007 10:29:14 +0000
jacob navia said:
Ian Collins wrote:
jacob navia wrote:
Ian Collins wrote:Your ignorance continues to astound. Maybe you should take some time
jacob navia wrote:You can't program in C++ without using classes. Even if you define
The difference between C and C++ is the object orientation of C++. CAre you really dense, or just being obtuse? As you have been told
is not object oriented.
many
times before, C++ is a multi paradigm language. You can *choose* to
write OO or procedural code in C++.
a simple structure it is actually a class.
out and learn C++ before slagging it off.
Yes Sir!
struct A {
int age;
char *Name;
};
int main(void)
{
A jacob;
}
This is valid C++ but invalid C.
Yes, for reasons which have nothing to do with classes.
In C++ each "structure" definition
is just a CLASS where all members are PUBLIC by default.
Stroustrup says much the same thing, albeit more quietly. But it can be
said just as correctly (or incorrectly) that, in C++, each "class"
definition is just a struct where all members are private by default. So
if the claim is that C++ is "all about classes" (which I don't accept),
then it can just as logically be said that C++ is "all about structs".
And, just as it is possible in C to write programs - *useful* programs -
that don't use structs, so it is possible in C++ to write useful programs
that don't use classes.
I see this
explanation in all C++ books I read but in my ignorance I believe
them. Stupid isn't it?
Yes - if you really want to know what a C++ struct is, the place to look is
ISO/IEC 14882.
<snip>
If you write
int main(void) { printf("hello\n");}
you do not need classes but is it C++?
The behaviour of that program, either in C or in C++, is undefined. (I
believe that C++ even requires a diagnostic message to be produced during
translation of that program.) If you want people to treat your views about
C seriously, you might want to start off by learning enough about C that
you can write a simple "hello" program properly.
<snip>
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: As a programmer of both languages...
- From: jacob navia
- Re: As a programmer of both languages...
- 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: C closures & lexical scoping
- Next by Date: Re: As a programmer of both languages...
- Previous by thread: Re: As a programmer of both languages...
- Next by thread: Re: As a programmer of both languages...
- Index(es):
Relevant Pages
|