User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 456,519 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,821 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 2073 | Replies: 3
Reply
Join Date: Jul 2004
Posts: 64
Reputation: koh is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
koh koh is offline Offline
Junior Poster in Training

Help Helping for initialization

  #1  
Aug 10th, 2004
for a simple program...

#include <iostream>
using namespace std;
int main()
{int x;
cout << "enter password\n";
cin >> x;
return 0;
}

for the pink colour part..
if i want my password to be in integer and alphabets, so what command line should i put?

and when i enter a password... i want it to reveal the code in this form "*****". How should i do that?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2004
Posts: 2
Reputation: saji is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saji saji is offline Offline
Newbie Poster

Re: Helping for initialization

  #2  
Aug 12th, 2004
Originally Posted by koh
for a simple program...

#include <iostream>
using namespace std;
int main()
{int x;
cout << "enter password\n";
cin >> x;
return 0;
}

for the pink colour part..
if i want my password to be in integer and alphabets, so what command line should i put?

and when i enter a password... i want it to reveal the code in this form "*****". How should i do that?
making "int " is replaced by char , you can get show the password in the form of alphabets
Reply With Quote  
Join Date: Aug 2004
Posts: 4
Reputation: bvvkrishna is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
bvvkrishna bvvkrishna is offline Offline
Newbie Poster

Re: Helping for initialization

  #3  
Aug 13th, 2004
instead of int use char for entering both int and char data. and u can do this very easily.

#include <iostream>
using namespace std;1
int main()
{
char c,str[20];
int i=0;

while((c =getch())!='\n') {
str[i]=c;
putch('*');
}
}
this program catches the text u type either in int or char. and will be stored in str. each time after accepting the character it will display '*' to hide the characters entered.
Reply With Quote  
Join Date: Aug 2004
Posts: 2
Reputation: saji is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
saji saji is offline Offline
Newbie Poster

Re: Helping for initialization

  #4  
Aug 17th, 2004
thank you for your valuable help
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 4:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC