Sorry, I'm trying to read in from a file
which will look something like this
3 4 5
5 -3 222
2 1 45
42 -5 2345
etc...
I have three integers that I want to store the numbers into -->
int x, y, c.
(btw this is the simple diophantine linear equation)
But I'm running into problems such as "there are two int mains", "main must return an integer (which i did..?)"
can someone guide me into what might be the right steps into storing integers? or possibly what am I doing wrong?
my plan is to go one line at a time, simply store each line into the proper variables, and check if the d.l.e. is valid... then traverse the next line-> repeat process.
Please do not tell me the answer. Just guide me. I want to learn lol.
input.cpp:12: error: new types may not be defined in a return type
input.cpp:12: note: (perhaps a semicolon is missing after the definition of â)
input.cpp:12: error: two or more data types in declaration of â
input.cpp:12: error: â must return â
input.cpp: In function â:
input.cpp:25: error: â has no member named â
input.cpp:27: error: no match for â in â
input.cpp:29: error: no matching function for call to â
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:602: note: candidates are: void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]
Oh right. Thanks. But now I am getting these errors:
input.cpp: In function â:
input.cpp:26: error: â has no member named â
input.cpp:28: error: no match for â in â
input.cpp:30: error: no matching function for call to â
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:602: note: candidates are: void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]
line 15 declares a vector of type int, but you want the typestruct _vector (perhaps a bad choice of variable name here) - hence the last error message. So you should have a typedef to make the typing easier - otherwise line 22 should have struct at the start.