[ create a new paste ] login | about

Link: http://codepad.org/f5RIxMUG    [ raw code | output | fork ]

C, pasted on Nov 23:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdint.h>
#include <stdio.h>

static int8_t str[] = {0x0E, 0x11, 0x00, 0x01}; /*グローバル変数*/

int change_data()
{
	char string[21] = {0};
	if (0 > snprintf(string,20,"0x%02X 0x%02X 0x%02X 0x%02X",str[0],str[1],str[2],str[3]))
		return -1;
	printf("%s\n",string);
	return 0;
}

int main(void)
{
	change_data();
	return 0;
}


Output:
1
0x0E 0x11 0x00 0x01


Create a new paste based on this one


Comments: