why do i get error: 'strcmp': identifier not found in visual studio 2010 C++ Express
#include <string.h>
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
printf("%d",(int)strcmp( "str1", "str2" ));
return 0;
}
Thanks
:( #include <string.h> :(
#include "stdafx.h"
Fun quirk of the MSVC compiler, it generates the exact same error when you compile it like that. Yes, not a lot of 'fun'. It skips everything to find the stdafx.h precompiled header include directive. The string.h doesn't actually get included. Fix:
#include "stdafx.h"
#include <string.h>
Always put the stdafx.h include first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With