New to VC++

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm new in VC++ and I'm trying to do this:

String* arguments[] = Environment::GetCommandLineArgs();

if (arguments[1] == S"Hello")
Console::WriteLine(S"I got it!!!");

It's not working because I supose that arguments[1] is a pointer (Vb.Net has
no pointers). How can I solve this comparison?

Thanks
 
Juan Puebla said:
if (arguments[1] == S"Hello")
Console::WriteLine(S"I got it!!!");

It's not working because I supose that arguments[1] is a pointer (Vb.Net
has
no pointers). How can I solve this comparison?

Try this:

String* arguments[] = Environment::GetCommandLineArgs();

if ( String::Compare(arguments[1], S"Hello") == 0 )
Console::WriteLine(S"I got it!!!");

Regards,
Will
 
Thanks! It works.

Juan Puebla


"William DePalo [MVP VC++]" escribió:
Juan Puebla said:
if (arguments[1] == S"Hello")
Console::WriteLine(S"I got it!!!");

It's not working because I supose that arguments[1] is a pointer (Vb.Net
has
no pointers). How can I solve this comparison?

Try this:

String* arguments[] = Environment::GetCommandLineArgs();

if ( String::Compare(arguments[1], S"Hello") == 0 )
Console::WriteLine(S"I got it!!!");

Regards,
Will
 
Back
Top