|
|
C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp||In function 'int main()':| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|22|error: invalid initialization of reference of type 'std::fstream& {aka std::basic_fstream<char>&}' from expression of type 'std::ifstream {aka std::basic_ifstream<char>}'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|5|error: in passing argument 1 of 'int get_num(std::fstream&)'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|27|error: invalid initialization of reference of type 'std::fstream& {aka std::basic_fstream<char>&}' from expression of type 'std::ifstream {aka std::basic_ifstream<char>}'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|5|error: in passing argument 1 of 'int get_num(std::fstream&)'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|43|error: 'int get_num' redeclared as different kind of symbol| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|5|error: previous declaration of 'int get_num(std::fstream&)'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|43|error: 'fstream' was not declared in this scope| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|43|note: suggested alternative:| c:\mingw\bin\..\lib\gcc\mingw32\4.7.0\include\c++\iosfwd|165|note: 'std::fstream'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|43|error: 'fin' was not declared in this scope| ||=== Build finished: 10 errors, 0 warnings ===| |
int get_num(fstream& fin)
int get_num(istream& fin)
std::istream fin;
C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp||In function 'int main()':| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|22|error: invalid initialization of reference of type 'std::fstream& {aka std::basic_fstream<char>&}' from expression of type 'std::ifstream {aka std::basic_ifstream<char>}'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|5|error: in passing argument 1 of 'int get_num(std::fstream&)'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|27|error: invalid initialization of reference of type 'std::fstream& {aka std::basic_fstream<char>&}' from expression of type 'std::ifstream {aka std::basic_ifstream<char>}'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|5|error: in passing argument 1 of 'int get_num(std::fstream&)'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp||In function 'int get_num(std::fstream&)':| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|54|error: cannot convert 'std::basic_ios<_CharT, _Traits>::good<char, std::char_traits<char> >' from type 'bool (std::basic_ios<char>::)()const' to type 'bool'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|54|error: in argument to unary !| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|61|warning: control reaches end of non-void function [-Wreturn-type]| ||=== Build finished: 6 errors, 1 warnings ===| |
C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp||In function 'int get_num(std::fstream&)':| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|54|error: cannot convert 'std::basic_ios<_CharT, _Traits>::good<char, std::char_traits<char> >' from type 'bool (std::basic_ios<char>::)()const' to type 'bool'| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|54|error: in argument to unary !| C:\Users\Raezzor\Desktop\Coding Projects\pb picker\main.cpp|61|warning: control reaches end of non-void function [-Wreturn-type]| ||=== Build finished: 2 errors, 1 warnings ===| |
if (!fin.good())
and all is good. Now on to testing! Thanks for the help guys!
else if (!(fin.good))
else if ( !fin.good() )