Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- char * arrays(char *string, int n);
- int main(void){
- char *ptr2;
- ptr2=arrays("hi whassup", 5);
- int i;
- for(i=0; i<5; i++){
- printf("%c", *(ptr2+i));
- }
- printf("\n");
- return 0;
- }
- char * arrays(char *string, int n){
- char array2[80];
- char *ptr2;
- ptr2=array2;
- int i;
- for(i=0; i<n; i++){
- *(ptr2+i)=string[i];
- if (isspace(string[i]))
- break;
- }
- return ptr2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement