Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. //Imaginamos esto
  2.  
  3. char aux[15] = "Frase cortilla";
  4.  
  5. char **array;
  6.  
  7. int f = 0;
  8.  
  9. //Escribimos en el array a pelo
  10.  
  11. len_aux = strlen(aux);
  12.  
  13. for(int i = 0; i < num_filas_a_escribir; i++){
  14.     for(int p = 0; p < len_aux; p++){
  15.         sprintf(&array[p][i],"%c",aux[p]);
  16.     }
  17. }
  18.  
  19. //Resultado
  20.  
  21. ~>: Frase cortilla
  22.  
  23.  
  24. //Otra forma mas simple
  25.  
  26. strcpy(array[numero_fila],aux);
  27.  
  28.  
  29. //Resultado
  30.  
  31. ~>: Frase cortilla
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement