Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- //#define DEBUG
- #ifdef DEBUG
- #define DEBUG_PRINT(fmt, args...) fprintf(stderr, fmt, ##args)
- #else
- #define DEBUG_PRINT(fmt, args...) // ничего не делаем, если макрос DEBUG не объявлен
- #endif
- void stringcpy(char *str1, const char *str2)
- {
- while (*str2)
- {
- *str1 = *str2;
- str1++;
- str2++;
- }
- *str1 = 0;
- }
- void rec_del(char *string)
- {
- if (string[0] == ' ' || string[0] == '\0')
- {
- stringcpy(string, string + 1);
- return;
- }
- stringcpy(string, string + 1);
- rec_del(string);
- }
- int main(void)
- {
- char string[] = "hdsah sadh kek";
- rec_del(string);
- printf("%s", string);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement