Re: String with integers?
On Apr 7, 11:44 am, peter koch <peter.koch.lar...@gmail.com> wrote:
On 7 Apr., 09:58, James Kanze <james.ka...@gmail.com> wrote:>
On Apr 6, 11:42 am, Beej Jorgensen <b...@beej.us> wrote:
James Kanze <james.ka...@gmail.com> wrote:
<newsgroup.spamfil...@virtualinfinity.net> wrote:
look up itoa then :-)
Look it up where?
These days? Wikipedia. :)
That is NOT the place to look up a standard function. One
of the established standards or an established reference
work would be preferable, if you're interested in
portability. Otherwise, the documentation for your
compiler.
I never use wikipedia look up C++ questions, but I do use the
internet quite often. And I often use Wikipedia if there is
other stuff I want to check out.
I love the Wikipedia, and use it for a lot of things. But not
as a definitive reference work, for anything.
As for looking up the information on the Internet...
Regretfully, there are a lot of bad sites out there. Unless you
have some means of judging the quality or the authority of the
site, you have to be careful. (With some experience, of course,
you can often learn to recognize which sites are "authorities",
the Open Unix Standard for Unix, for example. Regretfully, I
don't think there is one for C++.)
http://en.wikipedia.org/wiki/Itoa
Which, when carefully read, does say that 1) the function isn't
standard, and can't be used portably, and 2) presents a number
of different signatures which it has had in older systems, so
even if you've got it, you have to first find out which version
you've got.
And you did not have to read very carefully. I found the
description there quite accurate and easy to read.
Yes, I read it carefully. While there's certainly nothing false
in it, I found the introduction somewhat misleading:
"widespread", "often provided", etc. Still, it's a lot better
than a few others I've seen.
There's even an awesome link to some ancient man pages
there.
I've got a copy of the version 7 Unix manuals on my machine
somewhere, too. I don't use them to find out about the state
of things today. What's more significant in the Wikipedia
article is what's missing: any links to a modern specification.
But they do link to opengroup.org for strtol, and the skim of
that documentation looked quite good.
Yes. My criticism here wasn't so much one of the Wikipedia
page, but of 1) it being cited as a reference for the function
(even though the page itself says that the function cannot be
used in portable code), and 2) the reference to "an awesome
link", which isn't relevant to the current question.
Just for the fun of it, it also looked up std::vector amd I
believe the documentation there also was fine, even if I would
not use it as a reference.
Because that's not its role. Especially not in such cases,
where accessible definite references (the original sources)
exist. I'm not criticizing Wikipedia, just the way it's being
used.
For a tutorial it was great although I found the illustrations
to push_back and pop_back a little confusing. The linkswere to
places I did not know - and to sgi which is not to good, but
there were references to the C++ standard which is good.
All in all wikipedia did well here.
It usually does. The only real problems are that it's not
always obvious when it doesn't, and that too many people are
trying to use it for something it isn't: an original source or a
definitive reference. It's probably not a good tutorial,
either---if you want to learn the STL, I'd recommend a book
(Matt Austern or Niko Josuttis), for example, rather than the
Wikipedia.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34