Password in a c++ program
March 15, 2009 at 9:22 am | In Ultimate Concepts-C++/C | Leave a CommentTags: how to add password in a program?, Password in a c++ program, password in c program
Many of us keep want this ultimate solution, “that how can we add provide a password facility in a c++ or c program?”. Yes password facility such that if user enter “UltimatePedia” as his password then it should be displayed over the screen something like-”*************”. So here i give you the solution of this query (asked to me by many of you through mails):-
#include<iostream.h> //Header file for cout and cin.
#include<conio.h> //Header file for clrscr().
void main()
{ clrscr(); //To clear off the screen.
char psw[20]; //Size of the password.
char psw2=13; //Basically here 13 is the ASCII value for the “Enter”.
int i=-1;
cout<<”Enter your Password:”;
do{ i++;
psw[i]=getch();
cout<<”*”; //Displays “*” instead of the characters entered by the user.
}while(psw[i]!=psw2); //This loop runs untill user press enter or character limit for password is reached.
cout<<”ntPassword is accepted. Your password is:”<<psw; //Optional facility which displays the password as entered by the user. Note that it does not show the password in the “*” form.
getch(); //Termination of the program.
}
Now do i hope you can modify this program according to your need in a program. And if you still have any queries related to its working then do ask me.
Data Structures
February 15, 2009 at 1:48 pm | In Ultimate Concepts-C++/C | 2 CommentsTags: Data, Data structure, entity, field, file, information, Queues, record, Stack
Basically it has been said that,”Algorithms+Data Structures=Programs” and that’s the reason why I chosen to discuss this topic first. Now before going into the detail of Data Structures first of all we should know some of the basic concepts regarding this topic:
*Data: Data is simply values or sets of values.
*Information: Data along with the attributes(columns) is called info. or Processed data is called Info. or you can also say that any meaningful data is the Information.For Example:-
i.e this whole set is called as information.
Now moving ahead we find that data can be organized in many different formats like the followings:-
1) Field: Small part of information is called as a field.For Example:-
i.e particularly column with an attribute is called as a field.
2) Record: It is the collection of fields(or values).
3) File: Collection of records.
But these organizations of data into fields, record, files may not be sufficient enough to handle all types of data’s. And so we bring into the action some another concepts like Data Structure and Data Base Management(DBMS) or File Management.
So finally we can define Data Structures as:-”A simple organization of data which can be easily processed at any time and which consists of actual relationships of the data as in the real world.”
——————————To Be Continued——————————–
Any problem related C,C++,SQL or HTML?. Then post out it here.
Do visit our Network Blog,”ultimatechange“.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.










