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,
Code:
ABCDEF<--cursor here & hit tab (defined 4 spaces-->GHIJKL
or
Code:
<--cursor here & hit tab (4 spaces inserted)-->ABCDEFGHIJKL
I know that I am going to be using a for loop, I just am struggling with with the conditions.
Appreciate any help as always.