daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Aug 11th, 2018 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include <stdio.h>
  4.  
  5. char** StringToArray(char *sentence) {
  6.     char** strs;
  7.     int h = 0;
  8.     int j=0;
  9.     int k=0;
  10.     while (j!=strlen(sentence)-1) {
  11.         if (sentence[j] == ' ') {
  12.             h++;
  13.             k=0;
  14.         }
  15.         strs[h][k] = sentence[j];
  16.         j++;
  17.         k++;
  18.  
  19.     }
  20.     return strs;
  21.  
  22. }
  23.  
  24.  
  25. int main() {
  26. char** str = StringToArray("Ala ma kota");
  27. for (int i=0;i<3;i++) {
  28.     for (int j=0;j<30;j++) {
  29.     printf("%c", str[i][j]);
  30. }
  31. }
  32.  
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top