代做c | c代写 – COMP202 Practical Guide for Mac OSX users

COMP202 Practical Guide for Mac OSX users

代做app | java – 本题是一个利用app进行练习的代做, 对app的流程进行训练解析, 是比较典型的app/java等代写方向

app代写 代写app 移动开发

This document describes tools you can use on Mac OSX to aid in your practical work in COMP

Software Requirements

There are 2 pieces of software that you can download (they are free) and install.

  • Xcode (https://developer.apple.com/xcode/downloads/)
  • X11 server (http://xquartz.macosforge.org/landing/)
Xcode provides gcc which you can use for C programming on your Mac. However,
when doing assignments, you will still need to remote login to
ash.science.mq.edu.au or iceberg.science.mq.edu.au and use the gcc installation on
those Linux machines to compile and run your programs.
The X11 server will come in handy when you need to write code and compile the
code on ash and iceberg. If you need help with this, ask in your practical class.

Connecting to remote machines

*Terminal. app The terminal app on Mac OSX gives you a command line interface to Mac OSX. Every installation of OSX should have the terminal app already available. The default location of the app is /Applications/Utilities: the icon is circled below.

There are 2 machines running linux OS which we will use for COMP202: ash.science.mq.edu.au and iceberg.science.mq.edu.au. To use them we have to remote login to one of the machines from your mac.

  • For example to connect to ash, you would type the following command into the terminal command prompt.

$ ssh -X -2 [email protected]

if you are asked to store a finger print id (not exactly your thumb finger print, but a cryptographic finger print) after exec the command, please answer with y (single char of letter y). Once you enter your one id password, you are on the remote machine

The command will also start xquartz automatically. To check if X11 forwarding is working correctly type the following command.

xeyes &

You should see a XWindow application opened, with a pair of eyes follow the mouse pointer.

Once you finish working on the remote machines, you must logout by issuing the logout command at the prompt

> logout

Compiling and Running First C Program On OSX (this also applies to linux

and generally GCC compiler collection).

The screen shot above shows how to write your first C program, compile and run. (Please note that on most Unix based machine everything is case sensitive, including file names).

NOTES:

 The cat command is used here to save what you type into a file. For this to work, you
have to type the lines of the program exactly as listed above without any mistakes.
This is actually a difficult way to write a program, which is why you will need to use an
editor in the future. The Unix terminal-oriented editor is called vi.
 You don't type ^D as it appears in the screen shot, but you hold down the Ctrl key and
hit d, which is known as pressing CTRL-d. Unix displays it on the screen as ^D. CTRL-
d is an end of file character when you are typing on a Unix terminal.
 The less command is the command to view a file. Hit the Esc key to exit the less
program. There are other commands in less that allow you to view the file one
screenfull at a time by pressing Space or Return to move through the file.
 The gcc command compiles the C source program HelloWorld.c into an executable
program called HelloWorld. Computers cannot execute C programs, or  java programs,
or any other programming language directly  computers only execute their own
machine instructions (which we will learn about in COMP202). So we use the gcc
compiler to convert our C program into machine instructions that the computer can
executed, and then we tell it to run our compiled program.
 The command ./HellowWorld is how we tell Unix to run our executable program
HelloWorld. ./ means to find the program in the current directory.