S
Sloopy
Guest
Using files with Xcode
Hello guys
I am a Windows convert now using mac!
In my egr115 class (intro to computer programing.... and I am an Aerospace engineer major?!?!? ) We have been doing a lot of C programing, recently (in the last month or two) we have started to use files. When our class started using files I could not get them to work with xcode so I switched over to bloodshed on windows. Now our professor has assigned us a final project and I would really like to use my mac to do this. our final project has lots and lots of text files to read and write too.
Lets say I write a program like this: (this real basic)
#include <stdio.h>
#include <stdlib.h>
main()
{
FILE *Fprint;
Fprint = fopen("print.txt", "w");
fprintf(Fprint, "hello");
fclose(Fprint);
return(0)
}
I have tried creating that text file by going to the menu and creating an empty text file and saving in the directory, I have even tried to save it has a txt file (by typing txt in while I save it) and it still will not read or write to any file.
So here is my question;
How do I use files with xcode? What do I use to create them? (I have been using xtool), what do I save them as (txt or let the computer handle it, then if I do that, how do I declare it?)
Thanks
-Bill
Hello guys
I am a Windows convert now using mac!
In my egr115 class (intro to computer programing.... and I am an Aerospace engineer major?!?!? ) We have been doing a lot of C programing, recently (in the last month or two) we have started to use files. When our class started using files I could not get them to work with xcode so I switched over to bloodshed on windows. Now our professor has assigned us a final project and I would really like to use my mac to do this. our final project has lots and lots of text files to read and write too.
Lets say I write a program like this: (this real basic)
#include <stdio.h>
#include <stdlib.h>
main()
{
FILE *Fprint;
Fprint = fopen("print.txt", "w");
fprintf(Fprint, "hello");
fclose(Fprint);
return(0)
}
I have tried creating that text file by going to the menu and creating an empty text file and saving in the directory, I have even tried to save it has a txt file (by typing txt in while I save it) and it still will not read or write to any file.
So here is my question;
How do I use files with xcode? What do I use to create them? (I have been using xtool), what do I save them as (txt or let the computer handle it, then if I do that, how do I declare it?)
Thanks
-Bill