[ create a new paste ] login | about

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

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

int main()
{
  char line[80] = "48,8,10;\n\000\000age\000\070\000\060\000;\n\000\000;\n\000\000;\n\000\065,51;\r\n21,52;\r\n1, ...";
  int ret;
  unsigned char frameID,frameLength,frameDelay;

  ret = sscanf(line,"%hhu%*1c%hhu%*1c%hhu;\n",&frameID,&frameLength,&frameDelay);

  printf("ret:%d\nframeID:%d\nframeLength:%d\nframeDelay:%d\n",ret,frameID,frameLength,frameDelay);

  return 0;
}


Output:
1
2
3
4
ret:3
frameID:48
frameLength:8
frameDelay:10


Create a new paste based on this one


Comments: