Hello,
you can use the string type to store your password and what ever char you want.
you have two choices, the first one is to use an array of char or char *, the
second one is to use the string type in the STL;
#include <iostream>
#include <string>
using namespace std;
void main ()
{
// Try
char szPassword[100];
cout << "Enter your PW: ";
cin.getline(szPassword,100);
cout << "Your PW is : " << szPassword << "\r\n";
// Or Try
string sPassword;
cout << "Enter your PW: ";
getline(cin,sPassword);
cout << "Your PW is : " << sPassword.c_str() << "\r\n";
}
----- Original Message ----
From: perfectdance2050 <[EMAIL PROTECTED]>
To: [email protected]
Sent: Sunday, September 7, 2008 12:51:08 PM
Subject: [c-prog] variable problem
hye me saksham and my question is as we see in all the email id's we
can type any password either in alphabat or in number or we can say any
special character i want to ask if i want to make a c++ program and
want to introduce the password in it so i want to declare that data
variable in wch we can store all type of value is it possible to
make ... by c++
for example :
password : sam857**54%%
so is it possible in c++ to declare any variable for storing such type
of value ...
please send me the code related to this as i hav lot of problem
regarding this so please send who so ever know abt it ...
saksham dixit
[Non-text portions of this message have been removed]