开发者

XCode 4: file as command argument

开发者 https://www.devze.com 2023-03-07 10:06 出处:网络
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:

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消