|
From: Ioannis V. <no...@ya...> - 2001-10-19 08:24:13
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Jason Hardman > Sent: Friday, October 19, 2001 12:13 AM > To: Dev-C++ > Subject: Re: [Dev-C++] Errorhandling >=20 >=20 > I think the strcat(szDatei, " \0") was to insert a space=20 > between the comand line arguments when concatenating them.=20 The proper in this case would be: strcat(sdDatei, " "); > Any string literal will be automatically NULL terminated=20 > anyway, but putting in the extra NULL wouldn't cause any harm=20 > as strcat would just ignore it. A C++ string would be better, We do not know if it would ignore it, it could end up in a concatenated string having a double '\0', and in the next call of strcat() it could end up in something like that: [stringonestringtwo\0stringthree...\0] That is we do not know how a strcat() implementation works (perhaps from the end towards the beginning) and it could replace the last '\0' only. In any case that '\0' is not needed. =20 > but perhaps he was intentionally writing in pure C? Perhaps, but he spoke for exceptions so i assumed knowledge of C++ so i assumed C++. :) > I've been haveing a look at the C99 standard of late and some=20 > of the developments in there would make it useful to use C=20 > instead of C++. C is no longer a subset of C++, although=20 C99 is not a subset of C++ but i can;t find a reason why using C99 would be more useful than C++ (i think exactly the opposite). > maybe in future they will extend C++ to include at least some=20 > of the inovations? Of course I don't think that the compiler=20 Only very few. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |