Re: passing a string to a C++ function
- From: "David Webber" <dave@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 6 Oct 2005 18:06:02 +0100
"Brian Muth" <bmuth@xxxxxxxx> wrote in message
news:eRvE9zoyFHA.1264@xxxxxxxxxxxxxxxxxxxxxxx
> It's an acceptable approach, although a more contemporary solution
> would be to use the standard template library to help with the
> string parsing and manipulation. strtok() is now considered
> "unsafe" (although that alone won't stop me from using it from
> time to time).
There seems to be a move towards warning people that all sorts of
things are "unsafe". I suspect this is a drive by Microsoft to cut
down on the number of people calling them when something crashes :-)
strtok is extremely useful - you just have to be aware of what it
actually does and treat it with respect (and test your code).
C and C++ have always been languages where you have to be aware of
what is going on in memory (allocating, freeing, changing contents)
when you do things. You can't just write it blindly and not worry
about that. Other languages - eg FORTRAN - were designed to
protect you completely from having to worry about memory.
Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm
.
- Follow-Ups:
- Re: passing a string to a C++ function
- From: Tom Serface
- Re: passing a string to a C++ function
- References:
- passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: Victor Bazarov
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: David Webber
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: David Webber
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: Brian Muth
- Re: passing a string to a C++ function
- From: Leo
- Re: passing a string to a C++ function
- From: Brian Muth
- passing a string to a C++ function
- Prev by Date: MS VC 6.0 compiles EXE differently under 2000 vs XP
- Next by Date: Re: passing a string to a C++ function
- Previous by thread: Re: passing a string to a C++ function
- Next by thread: Re: passing a string to a C++ function
- Index(es):
Relevant Pages
|