author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Mon, 06 Oct 2014 20:52:53 +0100 | |
changeset 211 | e6e160c7ea33 |
parent 202 | 6740798264c1 |
child 231 | 60e046ab6c94 |
permissions | -rw-r--r-- |
24 | 1 |
#include <string.h> |
2 |
#include <stdio.h> |
|
3 |
||
4 |
void foo (char *bar) |
|
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 |
e6e160c7ea33
added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
7 |
char buffer[28]; |
24 | 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 | 12 |
} |
13 |
||
14 |
int main (int argc, char **argv) |
|
15 |
{ |
|
211
e6e160c7ea33
added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
16 |
foo("my string is too long !!!!!"); |
24 | 17 |
return 0; |
211
e6e160c7ea33
added files
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
202
diff
changeset
|
18 |
} |