strtok and strtok_r
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > strtok and strtok_r




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    strtok and strtok_r  
siddhu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-14-07 06: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






[ Post a follow-up to this message ]



    Re: strtok and strtok_r  
CBFalconer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-15-07 12:22 AM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:48 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register