Topic: usage of standard wide-character functions
Author: Jie Zhao <zhao@isip.msstate.edu>
Date: 1999/08/09 Raw View
In 1998 version of the C++ standard, it lists the names of 99
standard C functions, but it doesn't give the usage of these
functions.
Where can I find the usages of those standard C functions, especially
those functions related to wchar, such as wcstok, wcsprint?
In gcc on Solaris 2.6, it defines,
extern wchar_t *wcstok(wchar_t *, const wchar_t *);
extern wchar_t *wcstok();
But in gcc on Solaris 2.6, it defines,
#if (!defined(_MSE_INT_H))
#if (defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)) /* XPG4 or XPG4v2 */
extern wchar_t *wcstok(wchar_t *, const wchar_t *);
extern size_t wcsftime(wchar_t *, size_t, const char *, const struct tm *);
#else /* XPG4 or XPG4v2 */
#ifdef __PRAGMA_REDEFINE_EXTNAME
extern wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **);
...
#if (!defined(_MSE_INT_H))
#if (defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)) /* XPG4 or XPG4v2 */
extern wchar_t *wcstok();
So I wonder what's the definitions of those C++ standard wchar functions,
and where I can find the usage of them.
Thanks.
-zhao
*****************************************************************
ZHAO JIE
Institute for Signal and Information Processing
Electrical and Computer Engineering Department
Mississippi State University
Web: http://www.isip.msstate.edu
Phone: 662-325-8335 (o)
******************************************************************
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: James Kuyper <kuyper@wizard.net>
Date: 1999/08/09 Raw View
Jie Zhao wrote:
>
> In 1998 version of the C++ standard, it lists the names of 99
> standard C functions, but it doesn't give the usage of these
> functions.
>
> Where can I find the usages of those standard C functions, especially
> those functions related to wchar, such as wcstok, wcsprint?
The current C standard was incorporated by reference into the C++
standard. You need to look at the C standard
<http://www.eskimo.com/~scs/C-faq/q11.2.html> for details on those
functions. It's fairly expensive, and Schildt's significantly less
expensive annotated version suffers from significant defects, both in
the annotations, and even in the "quoted" text.
The C++ standard explicitly encourages implementors to add features from
new versions of the C standard, as extensions to C++. Those extensions
stand a good chance of being incorporated in the next C++ standard. The
latest public draft of the next version of the C standard is available
for free at <http://anubis.dkuug.dk/JTC1/SC22/WG14/www/docs/n869/>, but
you can't be sure which of the functions you're worrying about has been
changed from the current version. Also, the final draft already contains
significant differences from the last public draft, so the public draft
version is unreliable both as a guide to C89, and as a guide to C9X.
The particular wide-character functions you're asking about correspond
to various features of the strings and facets portions of the C++
standard library; I'd recommend using those features in C++ code, rather
than the corresponding C functions.
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: clamage@eng.sun.com (Steve Clamage)
Date: 1999/08/11 Raw View
James Kuyper <kuyper@wizard.net> writes:
>The C++ standard explicitly encourages implementors to add features from
>new versions of the C standard, as extensions to C++.
Where does it say (or imply) that? The closest thing I could find
was the following paragraph, which I would not characterize as
"encouraging".
Section 1.4 Implementation compliance, paragraph 8:
"A conforming implementation may have extensions (including additional
library functions), provided they do not alter the behavior of any
well-formed program. Implementations are required to diagnose
programs that use such extensions that are ill-formed according to
this International Standard. Having done so, however, they can compile
and execute such programs."
--
Steve Clamage, stephen.clamage@sun.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: "James Kuyper Jr." <kuyper@wizard.net>
Date: 1999/08/11 Raw View
Steve Clamage wrote:
>
> James Kuyper <kuyper@wizard.net> writes:
>
> >The C++ standard explicitly encourages implementors to add features from
> >new versions of the C standard, as extensions to C++.
>
> Where does it say (or imply) that? The closest thing I could find
Section 1.2: "parties to agreements based on this International Standard
are encouraged to investigate the possibility of applying the most
recent editions of the standards indicated below."
I've been under the impression that the "parties" referred to included
implementors - the relevant aggrements being the ones they have to
provide standard-conforming implementations to their customers.
However, re-reading it in light of your reaction, that feels a little
forced. Who exactly are the parties that statement is intended to apply
to?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]