Here is a similar question on the topic with a good description of the file:
how to read NASA .hgt binary files
I am fairly new to programming in general and my efforts thus far have been very limited. My ultimate goal is to access the elevation data and store it in a 2D array for easy access. I have been trying to read the file 2 bytes at a time, as has been suggested, but I don't know what to do next. Here is what I've got so far:
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ifstream::pos_type size;
char * memblock;
ifstream file ("N34W119.hgt", ios::in|ios::binary|ios::ate);
if (file.is_open())
{
size = 2;
memblock = new char [size];
file.seekg (0, ios::beg);
file.read (memblock, size);
//I don't know what to do next
file.close();
}
return 0;
}
Thanks for any help!