Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Feynman Eye

macrumors newbie
Original poster
Feb 20, 2015
3
0
Hi,

I am trying to read a file in c Programming using Xcode. I know the basic syntax of going about this task, but the program is unable to find the file I am trying to read. The file does exist and I believe I have placed it in the "Project Directory" folder. I've been trying to get this to work for at least 3 hours in total. The program does compile and build, but it says "Null" in regard to finding the file. Can someone help me?

I have attached a picture of my code and project navigator.

Thanks you.
 

Attachments

  • Code.png
    Code.png
    79.8 KB · Views: 147
  • Project Navigator.png
    Project Navigator.png
    55 KB · Views: 124
Hi,

I am trying to read a file in c Programming using Xcode. I know the basic syntax of going about this task, but the program is unable to find the file I am trying to read. The file does exist and I believe I have placed in the "Project Directory" folder. I've been trying to get this to work for at least 3 hours in total. Can someone help me?

You need to change the working directory of Xcode, or use an absolute path to the file.
 
You need to change the working directory of Xcode, or use an absolute path to the file.


Thank you for replying. How do I go about changing the working directory of Xcode. I have been trying to do that for the past hour.
 
Thank you for replying. How do I go about changing the working directory of Xcode. I have been trying to do that for the past hour.

I believe it's in edit scheme, alternatively it may work to drop it into products where the executable file is.
 
I believe it's in edit scheme, alternatively it may work to drop it into products where the executable file is.

I have tried dropping it into Product, it gave me the same results. What do I do exactly in edit scheme?

----------

You need to change the working directory of Xcode, or use an absolute path to the file.

Thank you, so much!! I finally got it to work. :D:D:D:D:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.