Hello,
I am new to C programming and am trying to write one my first programs. The program rather simple, but seeing as my background is really Fortran, I am having a bit of trouble making it work.
Basically, I want to convert 16 bit float to 32 bit float and vice versa. This alone is not much of an issue ( I am sure I will figure it out), but the issue becomes somewhat complicated since I also wish to convert Big Endian to Little Endian and vice versa. This is almost trivial at this point, but I was thinking I want to use one array to do all of this. There is no reason I cannot read in any type into a common array (using stdin?), then output the response.
What I cannot figure out is how to use that function in C to read in the format into a standard array (e.g. it doesnt matter what format the data was in before, it goes into a standard array). I would love a resource to help me determine the proper "adapter" array, that will take any of these data formats so I can work on doing the conversions.
I also am having trouble detemining how to convert from the original type to the new type efficiently. I can always use a series of n^2 functions to do this, but I should be able to do that more efficiently. Any input on this would be appreciated.
I am not looking for a solution by any means, just ideas and resources so I can make this work. I need to increase my proficiency in the syntax of C. Any assistance to get me going is appreciated.
Darryl