Unix Programming - strtok and strtok_r

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > September 2007 > strtok and strtok_r





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author strtok and strtok_r
siddhu

2007-09-14, 1:23 pm

Dear experts,

As I know strtok_r is re-entrant version of strtok.
strtok_r() is called with s1(lets say) as its first parameter.
Remaining tokens from s1 are obtained by calling strtok_r() with a
null pointer for the first parameter.
My confusion is that this behavior is same as strtok. So I assume
strtok_r must also be using any function static variable to keep the
information about s1. If this is the case then how strtok_r is re-
entrant?
Otherwise how it keeps the information about s1?

Regards,
Siddharth

CBFalconer

2007-09-14, 7:22 pm

Ben Pfaff wrote:
> siddhu <siddharth.sng@gmail.com> writes:
>
>
> This is true on a system compliant with, e.g., POSIX, but it is
> not required by C. Followups set.


In addition, all names beginning with 'str' and followed by a lower
case char are reserved to the system. Thus strtok_r is not an
available name for the user.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>



--
Posted via a free Usenet account from http://www.teranews.com

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com