Re: pspell tweak.

From: Date: Wed, 13 Aug 2008 23:37:49 +0000
Subject: Re: pspell tweak.
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-39943@lists.php.net to get a copy of this message
C++ is a superset of C thus any C code can be complied as C++ as long as it doesn't use any C++ reserved words.
That is not true at all, although it's a common misconception. Just try the following in C and in C++: printf("sizeof('x') == %d\n", (int)sizeof('x')); (hint: they will give you different results). And there are many more differences.. Nuno
Yes.. there are some differences, but if your very careful with your typing.. C can be compiled with a C++ compiler. printf("sizeof('x') == %d\n", (int) sizeof((char)'x')); gives the same output of 1, with gcc and g++. I really don't want to be a troll. I still espouse that compiling a C program with a C++ compiler even if you never actually run it that way is a definite advantage to catch type checking problems.
Yes sure. I was just warning that compiling foreign C code with a C++ compiler is dangerous because you don't know if it's using some C specific feature or not. Anyway this is already too much offtopic :) Nuno

« previous php.internals (#39943) next »