I have a C program (addfilexcode.c
) that compiles and runs perfectly fine on terminal.
Does anyone know how to add a simple text file (i.e.
sched.txt
) on to Xcode so I can run my C program on thissched.txt
?
I tried adding it into the "Products" folder already and it did not work.Do I need a certain command on my C program to have it specifically go through this
sched.txt
file in Xcode?
addfilexcode.c
:
/* purpose: filters some data replacing semicolons with tab chars
input: text
output: text with tabs in place of semicolons */
int main(){
int c;
while( (c = getchar()) != EOF )
{
if ( c == ';' ) c = '\t'; /* replace */
putchar(c); /* send to output */
}
return 0;
}