how do you open a file with argv

Pages: 12
1
2
3
4
5
6
7
8
9
10
11
void computeCalories (const char* nutrientFileName, const char* recipeFileName)
{
    std::ifstream inFile;
    inFile.open(nutrientFileName);
    //open first file/ read



    std::ifstream inFile2;
    inFile2.open(recipeFileName);
    //open 2nd file/ read 
and its called with:
computeCalories (argv[1], argv[2])
When you run your program, how are you actually running it?

I think you may need to look at command line arguments a bit more.
just with codeblocks and hit run
I completely agree with iHutch105's last post.

google "command line arguments codeblocks".
alright, thanks
Topic archived. No new replies allowed.
Pages: 12