Hello again, everyone.
I'm currently developing a ASCII text file reader, to create my game in.
So I went and found this tutorial.
However, when I try to create my own program using either MingW or Dev C++, I get a heap of error messages like:
Code:
--------------------Configuration: Map_Scripter - Debug--------------------
Compiling...
main.cpp
main.cpp: In function `int main(int, char**)':
main.cpp:17: error: no match for 'operator>>' in 'banner >> title'
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\istream.tcc:87: note: candidates are: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>&(*)(std::basic_istream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\istream.tcc:93: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_ios<_CharT, _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\istream.tcc:102: note: std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base&(*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>]
I dont really understand these errors (not using functions correctly?) and was wondering if anyone know whats happening.
So heres my source:
Code:
//Map scripter -an ASCII text interpruter, supposedly able to create ASCII games,
//I should probaly allow it to read binary files, to hard-code Vacuus
#include <cstdio>
#include <cstdlib>
//Required for I/O:
#include <fstream>
using namespace std;
//Prototypes
char title[20][40]={' '}; //Title, to be read from ./data/title.txt
ifstream banner("data\title.txt"); //Banner input, should be stored into title
//I need to add the other prototypes for the reader to, this version is meant to just read the banner
int main(int argc, char *argv[])
{
for ( int eY; eY < 20; eY++ )
{
for ( int eX; eX < 40; eX++; )
{
banner >> title[eY][eX];
}
}
for (int y; y < 20; y++)
{
for (int x; x < 40; x++)
{
cout<<title[y][x];
}
}
system("\nPAUSE");
return 0;
}
Thank you in advance