+ 2
How to remove first character from a string
input-skillrack output-killrack In printf what should I fill so that all characters except first character is printed #include <stdio.h> int main() { char s[100]; scanf("%s",s); printf(" ") }
4 Answers
+ 8
printf("%s\n", s + 1);
s + 1 means start printing from the second character (having index -> 1).
This isn't really removing first character though, just skipping the first character while printing.
+ 4
You can print string from s[1] to last character s[s.length()-1] by a loop....
if you want to just by printf then use s+1 :
printf("%s",s+1);
+ 3
Done thank youđ
0
For removal you could use: memmove(s, s + 1, strlen(s));