Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4.  
  5. char* twister(char word){
  6.     int size = sizeof(word)/sizeof(char);
  7.     char* word2=malloc(sizeof(char)*size);
  8.     int i;
  9.     for(i=0;i<size;i++){
  10.             word2[i]=word[size-i];
  11.             }
  12.     for(i=0;i<size;i++){
  13.         printf("%1s",word2[i]);
  14.     }
  15.  
  16.     return word2;
  17.  
  18. }
  19.  
  20. void main(){
  21.     char word[]="Ebbe ist doof";
  22.     int size = sizeof(word)/sizeof(char);
  23.     char* word2=malloc(sizeof(char)*size);
  24.     word2=twister(word);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement