how to create a password program in c++ .. please give me some code .. thanks

What do you exactly mean by a password program? It can work on many levels.
You can have a file that can keep track of passwords and which are encrypted too.

So, it can be as complex as possible. Assuming you need a simple program which
echoes a particular symbol when you press any key, here is what i think, you can do:

As far as i know, there is no standard function that does not echo characters. Turbo C provides one such function: getch().

On linux, i think ncurses provides such a function.

Anyway, let me call that function as wontEcho()


So,

while ( (ch = wontEcho()) != '\n') {
     arr[i++] = ch; // store it in an array
     printf("*");   // print the character
}

eg:

You type: asdfg
the array has asdfg but is echoed as *****

Hope this helps.

Be a part of the DaniWeb community

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