2

How do i make a file an argument for a c++ file in Xcode 4? now when i run my project i have to do it in terminal with:

g++ mainFile.cpp -o main.out < inputfile.txt

i want to be able to do the ' < inputfile.txt ' part in XCode so i can use the debugger etc.

in my code i use the inputfile via cin like so:

cin>>dim; 

for (int i =0; i<dim; i++) {
    for (int j =0; j<dim; j++) {
        cin>>A[i][j];
    }
}

I'm following a beginner course in c++ so this is the way the code has to be. i just want to run it in XCode so badly! Thnx

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Tooster
  • 21
  • 2

1 Answers1

1

Read CedricSoubie's answer to the following Stack Overflow question:

How do you specify command line arguments in Xcode 4?

Community
  • 1
  • 1
Swift Dev Journal
  • 19,282
  • 4
  • 56
  • 66
  • Just to make it clear, command line arguments can include redirection. I'm deleting my answer, because I think I was using Xcode 3. – andrewdski May 22 '11 at 18:42