progs/C1.c
changeset 216 38718062709a
parent 112 0711775cb6b0
child 217 8ddf4fe6bf31
equal deleted inserted replaced
215:06cc38192865 216:38718062709a
     1 void foo (char *bar)
     1 #include <string.h>
     2 {
     2 #include <stdio.h>
     3   float my_float = 10.5;  // in hex: \x41\x28\x00\x00
       
     4   char  buffer[28];        
       
     5 
     3 
     6   printf("my float value = %f\n", my_float);
     4 void dead () {
     7   strcpy(buffer, bar);  
     5   printf("I will never be printed!");
     8   printf("my float value = %f\n", my_float);
       
     9 }
     6 }
    10  
     7 
    11 int main (int argc, char **argv)
     8 
    12 {
     9 int main(int argc, char **argv) {
    13   foo("my string is too long !!!!! ");
    10 
    14   return 0;
    11   char buffer[8];
       
    12 
       
    13   strcpy(buffer, argv[1]);
       
    14 
       
    15   return 1;
    15 }
    16 }
    16 
    17 
    17 
    18 
    18 
    19 
    19 
    20