possibly simple question
and hopefully, I can ask this in a way that makes sense.
can anyone tell me an efficient way to take data from a file, and change the format that it's shown?
for example:
I've declared a structure (I'm following an assignment that has a specific data file format), and for the month member variable (samplestructure.month), I'm taking in an int.
However, for the output, I'm supposed to output the actual month, not just the number of the month. I have more than one instance of this type of variable. And I can't think of anything short of writing a for loop that would go through and check each possibility; I'd also have to declare another member variable (I think) because I don't think I can change the data type of the member variables.
I feel like I'm missing some obvious, noncomplicated answer.
Any suggestions? Thanks.
can anyone tell me an efficient way to take data from a file, and change the format that it's shown?
for example:
I've declared a structure (I'm following an assignment that has a specific data file format), and for the month member variable (samplestructure.month), I'm taking in an int.
However, for the output, I'm supposed to output the actual month, not just the number of the month. I have more than one instance of this type of variable. And I can't think of anything short of writing a for loop that would go through and check each possibility; I'd also have to declare another member variable (I think) because I don't think I can change the data type of the member variables.
I feel like I'm missing some obvious, noncomplicated answer.
Any suggestions? Thanks.
