progs/C0.c
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 12 Nov 2015 08:25:22 +0000
changeset 428 39fa24c5d85e
parent 400 f05368d007dd
child 467 da4896f201b5
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#include <string.h>
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
#include <stdio.h>
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
void foo (char *bar)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
{
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 202
diff changeset
     6
   long my_long = 101010101; // in hex: \xB5\x4A\x05\x06
393
cb308583d86c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 231
diff changeset
     7
   char buffer[28];        
24
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
211
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 202
diff changeset
     9
   printf("my_long value = %lu\n", my_long);
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 202
diff changeset
    10
   strcpy(buffer, bar);    
e6e160c7ea33 added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 202
diff changeset
    11
   printf("my_long value = %lu\n", my_long);
24
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
}
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
 
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
int main (int argc, char **argv)
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
{
400
f05368d007dd updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 394
diff changeset
    16
  foo("my string is too long !!!!! ");    
24
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
  return 0;
393
cb308583d86c updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 231
diff changeset
    18
}