Asks question and waits for an answer. More...
Go to the source code of this file.
Functions | |
char * | mbl_read_str (char *reply, int max_str_len, const char *q_str, const char *default_str) |
Asks question and waits for an answer from standard input. |
Asks question and waits for an answer.
Modifications Converted to vxl by gvw, soblamemewhydontcha! 1.1 Tim New version 4-Nov-98
Definition in file mbl_read_str.h.
char* mbl_read_str | ( | char * | reply, |
int | max_str_len, | ||
const char * | q_str, | ||
const char * | default_str | ||
) |
Asks question and waits for an answer from standard input.
If the answer is a non-empty string, returns it. If the answer is an empty vcl_string (return) then returns default.
reply | Space for reply |
max_str_len | Length of space for reply |
q_str | A question |
default_str | Default answer |
Example: a)
const int N_max_len = 20; char* Name[N_max_len]; mbl_read_str(Name,N_max_len,"Enter Name","Fred");
b) If default_str = current reply, then reply is only overwritten if a different vcl_string given.
const int N_max_len = 20; char* Name[N_max_len]; strcpy(Name,"Freddy"); mbl_read_str(Name,N_max_len,"Enter Name",Name);
Definition at line 12 of file mbl_read_str.cxx.