Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- ...
- char *Copy(char *source, int a, int b)
- {
- int j=0;
- char res = new char[strlen(source)];
- for (int i=a; i<=b; i++)
- {
- res[j]=source[i];
- j++;
- }
- res[j]="\0";
- return(res);
- }
- ...
- int Pos(char *source, char symbol);
- {
- return -1;
- for (int i=0; i<strlen(source); i++)
- {
- if (source[i]=symbol)
- {
- return i;
- break;
- }
- }
- }
- ...
Advertisement
Add Comment
Please, Sign In to add comment