Convert String to time
Hi, i have a problem over here..
I am doing C programming on Visual Studio 2005, Console Application..
I know that this can be done, but however, the compiler does not recognize some methods and my project is unable to build..
my error lies here
/* Author: 054094F
Nanyang Polytechnic Singapore
Visual Studio 8.0
printf("Enter date of birth: (DDMMYYYY) ");
if (strptime(dob, "%d%m%Y", &tm) == NULL)
printf("Invalid date please try again");
printf("year: %d; month: %d; day: %d;\n", tm.tm_year, tm.tm_mon, tm.tm_mday);
Error 20 error LNK2001: unresolved external symbol _strptime getinformation.obj
Error 21 fatal error LNK1120: 1 unresolved externals C:\Documents and Settings\User\My Documents\NYP Assignments\Year3 Sem2\IT3784 - C, Linux\054094F_Week5_ASSN\Debug\054094F_Week5_ASSN. exe
Can anyone help?
Don't EVER use gets().
strptime, it appears, is not part of the Microsoft library set.
You may be able to find source for strptime in Linux or NetBSD C library source code.
erm is there an alternative way to do this in visual studio?
It would appear that there is no such function.
You may try this NetBSD C library implementation. It probably requires SOME adjustment to compile in a Windows environment, but I expect it to only be small work.
I got the NetBSD link from here: