TomCH

Q: How do I send cpp file from an Xcode project (college student)?

I am a distant learning college student in my first programming class. I am doing my homework in Xcode and sending to the instructor who uses Windows Visual Studio to evaluate my programs. The instructor wants only my cpp file for each assignment. I copy that file, name it like the college wants it, zip it and upload it to the college website (blackboard). On the other end, I am told that they can see no source file. I have not found this topic on Google. Any help would be greatly appreciated!!

MacBook Pro (Retina, 15-inch, Mid 2015), iOS 10

Posted on Sep 20, 2016 4:00 PM

Close

Q: How do I send cpp file from an Xcode project (college student)?

  • All replies
  • Helpful answers

  • by etresoft,

    etresoft etresoft Sep 20, 2016 5:03 PM in response to TomCH
    Level 7 (29,298 points)
    Mac OS X
    Sep 20, 2016 5:03 PM in response to TomCH

    Hello Tom,

    You shouldn't have to zip a source file. Is that what the instructions ask you to do? Normally when you download assignments from Blackboard they come in a zip file from Blackboard. Zipping seems like extra work both for you and the professor.

     

    Also, submitting only your cpp file would not be sufficient except for the most basic, "Hello World" file.

     

    Finally, can you describe in more detail how you are copying the file (and why) and how you are zipping it?

  • by TomCH,

    TomCH TomCH Sep 20, 2016 6:57 PM in response to etresoft
    Level 1 (4 points)
    Sep 20, 2016 6:57 PM in response to etresoft

    Thank you for helping.

     

    The course is C++, all assignments are a C++ programs. I get the assignment instructions in a pdf file. I write the program in Xcode; it builds successfully and results in the desired output. I click on the main.cpp, and duplicate it to my desktop. The assignment instructions specify that the source files be zipped before turned in. So, I compress the file and rename the zip version as the instructions dictate. I do leave the Xcode suffix ".cp" on the file. My mentor (not an Apple person) does talk about a ".cpp" file. I wonder if the suffix is what prevents my file from being read in the college's Visual Studio program?

  • by etresoft,

    etresoft etresoft Sep 20, 2016 8:46 PM in response to TomCH
    Level 7 (29,298 points)
    Mac OS X
    Sep 20, 2016 8:46 PM in response to TomCH

    Hello again Tom,

    I am unaware of any ".cp" suffix in Xcode. How are you creating your Xcode projects? Xcode should give files a ".cpp" suffix. And again, except for literally "Hello World", C++ will make heavy use of header files - extremely heavy use. Most modern C++ projects are 90% headers. I kid you not.

     

    Are you sure that this class will only use standard C++ constructs? Generally I recommend testing using the environment with which you will be marked. Get yourself a Windows VM, install VS, and test there. You can develop in Xcode, but never submit without testing. Testing using the zip file that you create is a good idea.

  • by TomCH,

    TomCH TomCH Sep 20, 2016 9:22 PM in response to etresoft
    Level 1 (4 points)
    Sep 20, 2016 9:22 PM in response to etresoft

    Thank you for the advice. I had been avoiding getting the Windows stuff, but you have swayed my position. Thank you for your time.

  • by Wayne Contello,

    Wayne Contello Wayne Contello Sep 22, 2016 5:48 AM in response to TomCH
    Level 6 (19,267 points)
    iWork
    Sep 22, 2016 5:48 AM in response to TomCH

    Here is how to locate the actual file from the XCode Project:

    select the file (notice it is .cpp)

    Screen Shot 2016-09-22 at 7.30.30 AM.png

     

    right click:

    Screen Shot 2016-09-22 at 7.30.40 AM.png

     

    in the Finder you can then zip the file.  I recommend, however, zipping on the command line since the contextual menu for compress adds "extra" stuff to the zip file.

     

    in a terminal window you can cd to the location of the file by typing :

    "cd "

    now drag and drop the folder that contains the file onto the terminal window.  When you do this, the terminal will insert the text for the path.

    Screen Shot 2016-09-22 at 7.36.09 AM.png

     

    now in there terminal zip the file like this:

    zip AssignmentName main.cpp

     

    this mean zip the file main.cpp into a zip archive named AssignmentName (you should set this name as required)

     

    the zip file will be in the same folder as the main.cpp

     

    you can test you code on line using this link:

    http://rextester.com/l/cpp_online_compiler_visual

     

     

    I suggest you work through this with your professor since your grade depends on it.  Also try testing what ever you do on lab computer (if available) but avoid testing on classmates computers so as to avoid any appearance of plagiarism.