Relative Content

Tag Archive for cparsingfile-io

fscanf skips leading 7 from memory address

I would like to read lines from a file (memory traces from Valgrind). Each line in the file
is either of the “I 0400d7d4,8″ or ” M 0421c7f0,4″ format (i.e. white space at beginning of the line). When the code below reads the file and steps through the file, memory addresses starting with a leading 7 are output without the 7, i.e. 7ff000398 becomes ff000398. Leading zeroes are also omitted/skipped, but that is not an issue. However, given 7ff000398 and ff000398 are different locations (numbers), and I need to partition the address for further processing.