$ g++ -o comp competitie.cpp
competitie.cpp:11:1: error: expected unqualified-id before ‘{’ token
{
^
competitie.cpp:14:40: error: elements of array ‘player playerlist [100]’ have incomplete type
player playerlist[players_size] = {NULL};
^
competitie.cpp:14:40: error: storage size of ‘playerlist’ isn’t known
competitie.cpp: In function ‘void load_players()’:
competitie.cpp:24:10: error: expected unqualified-id before ‘.’ token
ofstream.open ("players",ios::in);
^
competitie.cpp:28:53: error: no matching function for call to ‘getline(std::ofstream&, std::string&)’
while (n < players_size && getline(myplayers, line))
^
competitie.cpp:28:53: note: candidates are:
In file included from /usr/include/c++/4.8/cstdio:42:0,
from /usr/include/c++/4.8/fstream:41,
from competitie.cpp:3:
/usr/include/stdio.h:678:20: note: __ssize_t getline(char**, size_t*, FILE*)
extern _IO_ssize_t getline (char **__restrict __lineptr,
^
/usr/include/stdio.h:678:20: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/4.8/string:52:0,
from /usr/include/c++/4.8/bits/locale_classes.h:40,
from /usr/include/c++/4.8/bits/ios_base.h:41,
from /usr/include/c++/4.8/ios:42,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from competitie.cpp:1:
/usr/include/c++/4.8/bits/basic_string.h:2793:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)
getline(basic_istream<_CharT, _Traits>& __is,
^
/usr/include/c++/4.8/bits/basic_string.h:2793:5: note: template argument deduction/substitution failed:
competitie.cpp:28:53: note: ‘std::ofstream {aka std::basic_ofstream<char>}’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
while (n < players_size && getline(myplayers, line))
^
In file included from /usr/include/c++/4.8/string:53:0,
from /usr/include/c++/4.8/bits/locale_classes.h:40,
from /usr/include/c++/4.8/bits/ios_base.h:41,
from /usr/include/c++/4.8/ios:42,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from competitie.cpp:1:
/usr/include/c++/4.8/bits/basic_string.tcc:1068:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
getline(basic_istream<_CharT, _Traits>& __in,
^
/usr/include/c++/4.8/bits/basic_string.tcc:1068:5: note: template argument deduction/substitution failed:
competitie.cpp:28:53: note: ‘std::ofstream {aka std::basic_ofstream<char>}’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
while (n < players_size && getline(myplayers, line))