Hi Im tring to do a simple match here , and that which should match
isn't . it's a pretty simple program. but I dont see the problem
anyone have an inkling?
thanks
Jeff
Code:
~$ cat argtest.c++
#include<iostream>
using namespace std;
int main(int argc, char * argv[])
{
char *x;
x=argv[1];
cout << " the value of X is "<<x<<endl;
if( x == "xy" )cout<< "it matches !"<<endl;
else cout<<" no match:"<< endl;
}
~$ g++ argtest.c++ -oargtest
~$ ./argtest xy
the value of X is xy
no match:
other useful (?) info
:~$ g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu
Thread model: posix
gcc version 4.1.2 20060814 (prerelease) (Debian 4.1.1-11)