I am just trying to figure out how to program the file to read input from however CodeEval.com does there thing. They say its from a *nix enviroment. I would've thought this code below would work, but I don't understand getline() very well. Also if I were reading line by line I don't think the way I'm reading in variables is the right way. Any help or explanation on how to do this challenge would be helpful. I just don't understand how they are wanting the file to be read in.
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[]) {
ifstream stream(argv[1]);
string line;
while (getline(stream, line)) {
Thanks man. That looks good. I was just having a really hard time figuring out how to read in a *NIX environment.
Are you putting if (argc != 2) return 0; assuming they are only inserting 1 file into the program? I am just a little confused at how they are reading it in. I am guessing that they are compiling it and then running the executable from the command line and they are inserting just one file...right? How can they do that with a list of numbers needed for the FizzBuzz test?