[ create a new paste ] login | about

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

C, pasted on Sep 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <stdio.h>

int main (void) {
	unsigned char buff[] = {0, 100, 200};
	char value[] = "999";
	
	printf ("%d, %d, %d\n", buff[0], buff[1], buff[2]);
	
	sscanf(value, "%u", &buff[1]);

	printf ("%d, %d, %d\n", buff[0], buff[1], buff[2]);

	return (0);
}


Output:
1
2
0, 100, 200
0, 231, 3


Create a new paste based on this one


Comments: