471,056 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,056 software developers and data experts.

problem using strtok_s

I was using Visual C++ 6.0, where strtok worked quite fine.
But now i've been asked to use VS 2005 & i desperately need to use strtok_s. But during compilation, error is shown as 'strtok_s': identifier not found. i am comparatively new to VS 2005.

could anyone please help me.
Oct 23 '07 #1
6 9397
gpraghuram
1,275 Expert 1GB
I was using Visual C++ 6.0, where strtok worked quite fine.
But now i've been asked to use VS 2005 & i desperately need to use strtok_s. But during compilation, error is shown as 'strtok_s': identifier not found. i am comparatively new to VS 2005.

could anyone please help me.
strtok_s is thread safe version of strtok supported by POSIX.
I dont know Microsoft VS supports the same
Raghuram
Oct 23 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
strtok_s should be declared in string.h in Visual Studio.NET 2005.

I tried it on my mine and it works fine.
Oct 23 '07 #3
thanks for the reply.
when i included #include <string> instead of #include <string.h>,
the problem is solved.
what is the difference between the files string and string.h
Oct 24 '07 #4
gpraghuram
1,275 Expert 1GB
thanks for the reply.
when i included #include <string> instead of #include <string.h>,
the problem is solved.
what is the difference between the files string and string.h

#include<string> is the c++ header file while string.h is the c header file.

c++ version of string has a string class in it.

Other members please add to this

Raghuram
Oct 24 '07 #5
thanks.
now that cleared my confusion & everything works just fine.
Oct 24 '07 #6
weaknessforcats
9,208 Expert Mod 8TB
c++ version of string has a string class in it.
Not quite. The C++ version of the C header <string.h> is <cstring>.

The C++ <string> header is strictly a C++ Standard Library header. There are no C string functions in there. Secure or otherwise.
Oct 24 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by André Gasser | last post: by
4 posts views Thread by bmiras | last post: by
4 posts views Thread by Derek Timothy | last post: by
3 posts views Thread by Jacky Zhu | last post: by
2 posts views Thread by Kent Lewandowski | last post: by
1 post views Thread by sck10 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.