Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char * arrays(char *string, int n);
- int main(void){
- char *ptr2;
- ptr2=arrays("voila", 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];
- }
- return ptr2;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement