Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main (void)
- {
- char extention[] = "this string.css file";
- // establish a ponter and point to period
- char * ptr = strrchr(extention,'.');
- // advance ptr untill ' '
- for (char*i = ptr; *i != ' '; i++)
- {
- // store what ever ptr is pointing at in extention
- strncpy(array,ptr,1); // only printing '.' doesnt seem to be advancing the loop ?
- }
- printf("%s\n",extention );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement