No way to do this in standard C++. There are some nonstandard functions that do something like that (or at least something similar) though (I believe you can do this with ncurses, and if your compiler has conio.h you could probably do something similar with that).
well my compiler has conio.h . do u know how to do that. am really new in this . so if u know please tell me in details that a new c++ user can understand :D
Well, 2 things:
1) If I was you, I would just not do stuff like that. You can easily do that in GUI applications, consoles aren't exactly cut out for that kind of task.
2) Focus on learning the language first, before you get into puny details such as that. Start by removing unnecessary system's and goto's (which means, in most cases, ALL system's and goto's).
well for ur 1st statement .
i donot want to do any thing with c++. and this is my project for adding,deleting, showing , updating records. I had a great program that could do all those stuffs but my lecturer ask me to get more functions ( like that ) so i have work on in.
2nd statement .
i realized now that i should have pay attention when my lecturer was teaching the language. but now its too late i have to submit this project and donot have enough time to learn in details.
and the goto there i cannot go to mainpage ( the selection page without it ).
and i have a question now
1 2 3 4 5 6 7 8
cout << "Invoice no : ";
//getline(cin,dummy);
cin.getline (Book.invoice, sizeof(Book.invoice));
while (strcspn(Book.invoice,"qwertyuiopasdfghjklzxcvbnm1234567890") != NULL)
{
cout << "Invalid input! Please enter again! Invoice No.: ";
cin.getline (Book.invoice, sizeof(Book.invoice));
}
invoice is char in struct . how can i restrict its minimum value ?
and i cannot go to main page without it and i know that people can go without it .
now back to my main question
i saw people making the *** thing with their codes . but my problem is i do not have any passget(). i just entered the password so that i do not have to go through all the functions.( and my lecturer said its ok while it can work) so now how can i do it
i got this code on another web but i cannot get it working
1 2 3 4 5 6 7 8 9 10
char Text[255];
while(Text[i]!=13) //checks whether 'Enter' key is pressed
{ //The value of Enter key is 13
i++;
Text[i]=getch();
printf("*");
}
That's the code for entering a password. In that code, Text is the password that is being entered, and after the loop you have a ready-to-use cstring in Text.