| mferarri (6) | |||||
|
hi all, I'm having trouble finding out how to input a string. This is what i've got so far:
My compiler is giving me these errors:
thanks in advance, | |||||
|
Last edited on
|
|||||
| errcheck (2) | |
|
You should read up on the documentation of ncurses first. Futhermore, please use std::string when comparing strings like that; otherwise strcmp. The else if is pointless, just use else.And if you want that password to be secure, don't store it plaintext, instead store the hash (sha1 for instance), create the hash for the input, then compare the input hash with the password hash. I'll leave those open for you to figure out. For sha1, try crypt++. There are some other encryption libraries out there, that provide sha1, md5 and many more. | |
|
|
|
| mferarri (6) | |||
|
thanks errcheck, but I am just learning to code. after reading the manual i tried to test out if i could actually write a simple program using what i just read. this is just an example program. what i found was i dont even know how to do something as simple as get a string and print it out with ncurses (with iostream it is cin and cout). so i was wondering if anyone could show me how to write a string into a variable and print it out using ncurses. i found this: http://www.cplusplus.com/articles/4z18T05o/
this is what i wanted to achieve. i got it to run but i dont understand a couple of things: (void)echo(); // what does this do? char users_name[ 100 ]; //what does the square braces mean? getnstr( users_name, sizeof( users_name ) - 1 ); // getnstr is not in the documentation??? i am referring to: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ is this the official documentation? | |||
|
Last edited on
|
|||
| mferarri (6) | |||
|
I realised that there really isn't any good tutorials for learning ncurses except for: Dan Gookin's Programmer's Guide to Ncurses. I highly recommend this book because it has answered my question on how to print strings in ncurses. http://www.amazon.com/Programmers-Guide-NCurses-Dan-Gookin/dp/0470107596 This is where I should've started.
I get everthing in this piece of code except for why void is written inside the int main parenthesis. Thanks anyway errcheck. | |||
|
Last edited on
|
|||