3

Possible Duplicate:
strptime() equivalent on Windows?

I'm trying to convert a string to date. strptime taken from here does exactly what I want. However when I try to use it in my code the compiler complains about it:

error C2065: 'strptime' : undeclared identifier

I have included time.h header. I'm using visual studio 2003, also tried 2008.
Is this really a standard function? Is there another function I could use without having to install additional libraries like boost?

Community
  • 1
  • 1
atoMerz
  • 7,534
  • 16
  • 61
  • 101

1 Answers1

3

strptime is not standard C or C++; it is Unix. If you're on a non-Unix machine, it may be present, but more likely, you'll have to find an open source for it, and install it yourself. (In the case of Visual Studio, a lot of Unix specific functions are available, but with an underscore in front of the name. I don't know if this is the case of strptime, but you might try _strptime.)

James Kanze
  • 150,581
  • 18
  • 184
  • 329