Modified mostly from dileepkumar235's Login functionality in C-language
Inspiration from Narue and my previous post (Limit buffer Input )
This allows you to prevents the user from entering past the array limit (SizeOfArray) if the user enters more the curser will just automatically
backspace by 1 for eg (max is 5) "eifje|" -> ""eifj|" and will terminate the array when enter is inputed.
(If your using Visuall C++ include <conio.h>
and change
getch to _getch )
All others include <conio.h>
My compiler is Code Blocks SVN 6202 (Self Built)
Note: I didn't see any reason to return anything... post suggestions please... Thank you :) (I also have a double version that prevents the user from entering any alpha char... if requested I will post it...)
So if you want you can use it like this this:
string = malloc (SIZE_A);
ShellBufString ( string, SIZE_A );
printf ( "The string you entered is [%s]", string )/* Do stuff */
free ( string );