XCode 4: file as command argument
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 th开发者_运维问答e 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
Read CedricSoubie's answer to the following Stack Overflow question:
How do you specify command line arguments in Xcode 4?
精彩评论