I have a file with the following entries:
;LAYER:1CRLF
...
...
:LAYER:1047CRLF
(CRLF is carriage return line feed)
How do I parse the string to set a int to the LAYER value noting the string character changes based on the number of digits?
Printable View
I have a file with the following entries:
;LAYER:1CRLF
...
...
:LAYER:1047CRLF
(CRLF is carriage return line feed)
How do I parse the string to set a int to the LAYER value noting the string character changes based on the number of digits?
Use fgets() to read each line.
Use sscanf to parse each line.
Say for example
sscanf(buff,":LAYER:%d",&number);