Results 11 to 18 of 18
-
11th Jan 2012, 08:15 PM #11OPBannedWebsite's:
cityvillehelp.comi don't have time to play with you , just leave my post
-
11th Jan 2012, 08:16 PM #12OPBannedWebsite's:
cityvillehelp.comwhen the user inputs the values
the text is shown in astricks
one astrik for one character (this cannot be done using scanf function that is why i am using the purchar function and getch function )
and after storing the password in the array
quit entering password when Q or q is typed
then we have to display the password
the getch() function inputs the text from user without echoing ..
-
11th Jan 2012, 08:29 PM #13OPBannedWebsite's:
cityvillehelp.comI modified the progoram
and now the output is somewhat working
but still not fully working
here is the new code
PHP Code:#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
clrscr();
char pass[32], ch;
printf("Enter Password : ");
int j=0;
while(1)
{
ch=getch();
if(ch=='q' || ch=='Q')
break;
pass[j]=ch;
putchar('*');
j=j+1;
}
printf("\n\n Password is : %s",pass);
printf("\n\n Displaying pass is diff way");
for(int i=0; i<=32; i++)
printf("%c",pass[i]);
getch();
}
outout is
typed prateek as password
-
11th Jan 2012, 08:40 PM #14OPBannedWebsite's:
cityvillehelp.comHello,
Program more simplified by me
there is only one last problem
why is the @ sign OR ANY OTHER GRABAGE VALUE comming at the end of the password ??
PHP Code:#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
clrscr();
char pass[32], ch;
printf("Enter Password : ");
int j=0;
while(1)
{
ch=getch();
if(ch=='q' || ch=='Q')
break;
pass[j]=ch;
putchar('*');
j=j+1;
}
j=j+1;
pass[j]='\0';
printf("\n\n Password is : %s",pass);
getch();
}
OUTPUT
-
11th Jan 2012, 09:38 PM #15MemberWebsite's:
mnchost.comtry this
// test.cpp : Defines the entry point for the console application.
//
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int k=0,j=0;
char pass[32], ch=' ';
printf("Enter Password : ");
while(1)
{
ch = getch();
k=k+1;
if(ch=='q' || ch=='Q')
{
pass[j]='\0'; j=j+1; break;}
else if(((int)ch >32 && (int)ch <123 ) && (ch!='q' || ch!='Q'))
{
putchar('*');
pass[j]=ch;
j=j+1;
}
}
printf("\n\n Password is : %s",pass);
printf("\n\n Displaying pass is diff way ");
for(int i=0; i<j; i++)
printf("%c",pass[i]);
getch();
}
//complied in Oracle studio Enterprise Edition
-
12th Jan 2012, 12:18 PM #16OPBannedWebsite's:
cityvillehelp.comthxxxxx
nice buddy
-
12th Jan 2012, 12:18 PM #17OPBannedWebsite's:
cityvillehelp.comrep +1
-
12th Jan 2012, 12:26 PM #18OPBannedWebsite's:
cityvillehelp.comMy sir also solved the problem
the working program is nw
PHP Code:#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
clrscr();
char pass[32], ch;
printf("Enter Password : ");
int j=0;
while(1)
{
ch=getch();
if(ch=='q' || ch=='Q')
break;
pass[j]=ch;
putchar('*');
j=j+1;
}
pass[j]='\0';
printf("\n\n Password is : %s",pass);
getch();
}
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Md5 generation on Turbo C
By prateek in forum Web Development AreaReplies: 5Last Post: 14th Feb 2012, 08:42 PM -
Turbo C | scanf() | strange
By prateek in forum Web Development AreaReplies: 14Last Post: 14th Feb 2012, 04:24 PM -
Turbo C | Weird and amazing
By prateek in forum Web Development AreaReplies: 13Last Post: 11th Feb 2012, 04:57 PM -
Turbo Leech - FREE Rapidleech Server With 8 Premium Account
By Faizann20 in forum Useful SitesReplies: 9Last Post: 2nd Dec 2010, 05:00 AM -
DEDICATED,ACTIVE NEEDED - Moderators/GM's Needed with BENEFITS
By robert in forum Community CooperativeReplies: 0Last Post: 18th Jul 2010, 03:36 PM
themaPoster - post to forums and...
Version 5.22 released. Open older version (or...