Hello
I am a very new user of C++, so this is probably strikingly obvious but I've been stuck with it for a while.. Any help would be very much appreciated.
My programme is eventually to read a table of numbers (spatial data exported from a GIS) and do some calculations based on that information. I'm stuck at the reading the table bit.
I was trying to save all the data on an array, I'm not even sure that's possible, but I've tried:
______________________________________________
#include <iostream>
#include <fstream>
//...
using namespace std;
//...
#define horizontal 163
#define vertical 195
int SPACE [horizontal] [vertical];
int map()
{
ifstream inmap;
inmap.open("datacommas.dat"); //open a .dat file where 163x195 datapoints are saved, separated by commas
inmap >> SPACE;
inmap.close();
return 0;
}
//...
int main()
{
map();
//...
return 0;
}
______________________________________________
To which the g++ compiler comments:
(line where inmap >> SPACE is): no match for `std::ifstream& >> int[163][195]' operator
/usr/include/c++/3.2.2/bits/istream.tcc:83: candidates are:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>:
perator>>(std::basic_istream<_CharT,
_Traits>&(*)(std::basic_istream<_CharT, _Traits>&)) [with _CharT = char,
_Traits = std::char_traits<char>]
/usr/include/c++/3.2.2/bits/istream.tcc:92:
std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
_Traits>:
perator>>(std::basic_ios<_CharT,
_Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits
= std::char_traits<char>]
[and goes on for ages]
Thanks
Despina