Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cstring>
- void f1(char *p);
- //////////////////////////////////////////////////////////
- int main()
- {
- char sz[99]="Sony Pictures";
- int x = 0;
- for(int i = 0; i<strlen(sz);i++)
- {
- if(sz[i]==' ') {x = i;}
- }
- f1(&sz[x+1]);
- printf("%s\n", sz);
- }
- /////////////////////////////////////////////////////////////
- void f1(char *p)
- {
- int i = 0;
- printf("*p = %c\n", *p);
- while(p[i])
- {
- i ++;
- }
- printf("i = %d\n", i);
- for(int i2 = i; i2 >= 0; i2--)
- {
- p[i2+2] = p[i2];
- p[i2] = ' ';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement