author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Fri, 06 May 2016 13:15:08 +0100 | |
changeset 455 | 2d9e005100f4 |
parent 400 | f05368d007dd |
child 467 | da4896f201b5 |
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 |
393
cb308583d86c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
231
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 |
{ |
|
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 | 17 |
return 0; |
393
cb308583d86c
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
231
diff
changeset
|
18 |
} |