visual studio 2008 - Compare _TCHAR* argv[] entries from command line to _T("paramString") -


I know how to get the parameters from the command line I also know how to print them.

The problem I have is how to compare parameters of a string with argv [] array. The program runs but never gives results, where the parameter string is equal to one.

Thanks in advance.

  // Testing.cpp: defines the entry point for the console application // # include "stdafx.h" #include & lt; Iostream & gt; using namespace std; Int_teman (int argi, _TCHAR * argv []) {for (int i = 0; i and lt; rgc; i = i + 1) {if (argv [i] == _T ("find")) {Wcout & lt; & Lt; "Found in position" & lt; & Lt; I & lt; & Lt; Endl; } And {wcout & lt; & Lt; "Not Found" & lt; & Lt; I & lt; & Lt; Endl; }} Return 0; }  

In the form of other answers, strcmp () Or wsccmp () depending on whether you are defining a Unicode, which will be for you from _tcscmp () .


Comments