Using a pointer to a string to insert characters (spaces) and shift the remainder?
If I have a string, char str
and a pointer to a string char *ptr
and using curses.h with direct terminal input/output #DEFINE TAB_KEY 9 ASCII
and the cursor position on the string int *curpos
How can I do the following,
ABCDEF<--cursor here & hit tab (defined 4 spaces-->GHIJKL
I know that I am going to be using a for loop, I just am struggling with with the conditions.
<--cursor here & hit tab (4 spaces inserted)-->ABCDEFGHIJKL
Appreciate any help as always.