This is the mail archive of the
mailing list for the GCC project.
- To: Lista GCC <gcc-help at gcc dot gnu dot org>
- Subject: Strings.....
- From: Nelson Guedes Paulo Junior <npaulo at linux dot ime dot usp dot br>
- Date: Fri, 05 May 2000 08:49:47 -0300
Hello to everyone....
I need a really fast way to do the following:
I have a (char *) that contains am arbitrary string and have space to do
the desired operation. Now i need to left-shift the string from n
positions and fill the initial n position with space.
string = (char *)malloc(sizeof(char)*10);
string = "Hello\0";
When you execute the following code, will be printed:
"String value: Hello"
Note that now we have two spaces at the beggining of the string.
The function can assume that we HAVE space to do the operation, n
will be an positive integer, must run on Windows/Dos/Unix/Linux
systems and must follow the prototype:
char *left_shift_string(char *string,int n);
Nelson Guedes Paulo Junior
E-mail: <email@example.com> UIN: 2489382 (Tender AML)
HomePage: (Em eterna construção)