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?
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);
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.