Hi i am new to VC++, iam trying to implement the encoding of password

In Java ,

     **byte[] saltedPassword = (password + getSalt()).getBytes();**

output :

** SaltedPassword :[B@3eca90**

in Java, saltedPassword get encoded value in the same way i want to implement in VC++

How to do Encoding in VC++..?

Please anyone help for me.

Thanks in Advance..

Re: How to use getBytes() in VC++ 80 80

In c++ we use either cin or getline() to get characters from the keyboard, and you have to allocate the buffer yourself

Use this if the password contains no spaces

std::string  saltedPassword;

std::cin >>  saltedPassword;

if the password contains spaces then it's like this:

std::string  saltedPassword;

std::getline(std::cin, saltedPassword);

In both cases you have to include the standard c++ header files <string> and <iostream>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.