|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
Slow news day? Never fear, Digitimes is here. Serving up free hits for techblogs everywhere.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Trouble reading a .txt file with Xcode C++||aprofetto||Mac Programming||11||Jan 15, 2013 11:08 PM|
|Making a log file in Xcode Application||arjit||Mac Programming||6||Nov 23, 2009 06:04 PM|
|xcode command line c++ issues||dvince2||Mac Programming||3||Jan 2, 2009 05:14 AM|
|Always open .txt files in textmate.||Kalixa||Mac Applications and Mac App Store||3||Aug 20, 2007 01:30 PM|
|Xcode 2 Freezes in C++ Command line tool||CookieMook||Mac Programming||7||Oct 1, 2006 09:39 PM|
All times are GMT -5. The time now is 12:52 PM.