9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
guia03/ex06.c (294B)
   1 #include <stdio.h>
   2 #include <string.h>
   3 
   4 
   5 
   6 int main(void) {
   7 
   8     char origen[] = "Hello world!\n";
   9     size_t i, len;
  10 
  11     len = strlen(origen);    
  12     char destino[len]; /*    +1 for the '\0'    */
  13 
  14     for(i = 0; i <= len; i++)
  15         destino[i] = origen[i];
  16 
  17     printf("%s", origen);
  18     printf("%s", destino);
  19 
  20     return 0;
  21 }