Search code examples
c++cdata-structurestypesdata-storage

Best data type to store the values like 21.6.7.1 in C/C++


In 21.6.7.1, 21 represents the some segment, 6 represents some lane inside that segment and so on and so forth. The individual values need to be extracted.

One way to represent this is string, any other way which is better and more convenient than string?


Solution

  • A structure with a four fields? An array of 4 elements, can also be an option.