|Dec 23, 2009, 07:25 AM||#1|
Problem opening a *.txt file in Xcode Command Line Application
I am trying to manipulate a *.txt file in a Command Line Application in Xcode.
There is a text file that has for example two lines, with words/phrases and some numbers.
All I want to do is to search for the numbers, save them in some variables, sum them and after, write them in a new file.
My problem is that when I make fopen I get an error
error: expected '=', ',', ';', 'asm' or '__attribute__' before each word of my file
I don't know what to do, and the problem is that I don't know very well programming in C.
I am trying to learn.
Any help for understanding the problem and solving it would be appreciated!
I am waiting in hope for your enlightement!
|Dec 23, 2009, 08:46 AM||#3|
If you're programming in C, you don't need to use XCode. You can use TextWrangler (free), and write code in that, save it, and compile it from in Terminal with the command:
gcc -o your_program_name /path/to/your/program
gcc -o my_cool_program ~/Desktop/my_prog.c
(~ is your home directory in case you didn't know)
Official MR IRC
Look at me, I'm own a bunch of things and everyone must know about every single one.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Passing a text file into Xcode instead of using the command line (C language)||hollabit||Mac Programming||19||Mar 31, 2014 11:45 AM|
|Resolved: Trouble reading a .txt file in Xcode with C++||rayonix||Mac Programming||2||Jan 4, 2014 04:03 PM|
|Command line tools & Xcode 5 & Mavericks||ka-spot||OS X Mavericks (10.9)||1||Oct 24, 2013 09:35 AM|
|Unable to download the Command Line Tools (Xcode 5 DP3)||cili0||Mac Programming||4||Jul 25, 2013 01:01 PM|
|Xcode 4.6. Can't open .txt file||thrill4rishabh||Mac Programming||6||May 28, 2013 01:22 PM|
All times are GMT -5. The time now is 05:31 PM.