I need to read a
.h file and store all the values. For example,
.h files contain lines like so:
#define mbbh 5 #define gbnn 90 #define mkoll
I wrote some code to read this
.h file (where I use string array, search for
#define and get the value of the name i.e.,
( mbbh, gbnn)- arrayname ).
The problem I have is,
If any of these lines doesn't have the value
arraynameit throws an exception.
How would I get the value of
#definewhen it is not in position
#define gbbn 90
This define statement has a value, but how can I get it?
string lineParts = string.Split(line, ' ');
string lineParts = string.Split(line, ' ', StringSplitOptions.RemoveEmptyEntries);