Re: itoa() in Linux

From: Juha Laiho (Juha.Laiho_at_iki.fi)
Date: 11/06/05


Date: Sun, 6 Nov 2005 08:54:30 +0000 (UTC)


"Bruintje Beer" <me@knoware.nl> said:
>"Juha Laiho" <Juha.Laiho@iki.fi> schreef in bericht
>news:dk301u$ur8$1@ichaos.ichaos-int...
>> "Bruintje Beer" <me@knoware.nl> said:
>>>"googler" <pinaki_m77@yahoo.com> schreef in bericht
>>>news:1130531978.715232.34760@g49g2000cwa.googlegroups.com...
>>>> Hi all, I'm using the itoa function in my C code but it does not
>>>> compile in Linux 2.4 (Redhat). I have stdilb.h included.
>>>
>>>use stringstream instead
>>>
>>>string MyClass::Int2Asc(int intval)
>> ...
>>
>> Note; the original article discussed C code, not C++. The two languages
>> are different.
>
>you can use c++ compiler to compile c programs and have the advantage of c++
>string classes

.. at which point the code is no longer C (you can't compile it with a C
compiler). There is a case where a completely valid ANSI C program doesn't
go through a C++ compiler:

#include <stdio.h>
#include <stdlib.h>

int
main(int argc, char **argv) {
        printf("%d\n",10//*foo*/2);
        exit(0);
}

-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)