Hi all,
I'm writing C++ (which I hope to later compile with a Unix C compiler) and just want to compare command line arguments:
Code:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
char* outputdirectory;
char* searchdirectory;
for (int i=0;i<argc;i++)
{
if (strcmp(argv[i],"-o"))
outputdirectory = argv[i+1];
else if (strcmp(argv[i],"-d"))
searchdirectory = argv[i+1];
}
}
But I get this compiler error:
Error 1 error C2664: 'strcmp' : cannot convert parameter 1 from '_TCHAR *' to 'const char *' 20
Error 2 error C2440: '=' : cannot convert from '_TCHAR *' to 'char *' 21
Does anyone have a thought? I'm guessing it's something simple I'm overlooking, or that I need to do some character conversion?
Thanks...
-Ben