|
From: Luigi S. <gi...@li...> - 2003-02-27 05:11:28
|
On Tue, Feb 25, 2003 at 05:10:26PM +0200, Ioannis Vranos wrote:
> Actually that information is wrong. stdlib.h and cstdlib are part of the C++
> standard (the C subset of C++ but it doesn't matter). And do not confuse C++
> with C, they are different languages. Example:
>
> C99 code but not valid C++:
>
> #include <stddef.h>
> #include <stdio.h>
>
>
> int main()
> {
> size_t s=7;
>
> printf("%sz\n", s);
>
> }
>
>
> Even between C90 vs C++98 there are differences. For example:
>
> int main()
> {
> char s[10]="0123456789";
>
> return 0;
> }
>
> is valid C90 but not C++.
>
>
Hello Ioannis,
I do not know C99, but I seem to get that the "strange" part
of the C99 code you wrote is the format used: "s" is a (sort of)
integer and one can't print it as a string.
I'm more concerned about the second piece of code, as I happen to
use C89 and C++98). It looks OK to me for both the languages, could
you shed some light on why it is not C++98?
TIA
--
>> gisan >>
If you stand on your head, you will get footprints in your hair.
|