代做assignment | c++ – assignment 4

assignment 4

代做assignment | c++ – , 这个项目是c++代写的代写题目

ass代做 assignment代写 代写assignment

Running  assignment 4

Running in the gcc screen, with a makefile

From inside assign4.c (no matter what files are open, run from inside the file containing main):
i) Select Tools and, in its drop-down menu, Build.
If you now try to open a gcc file in the place where you are working, the list of available files to open
should include three .o files (assign4.o, dir.o and fat.o). You will need to select All Files (lower right
drop-down menu) instead of All Source, to see these files listed. Build has organised the compiling
step. You will also notice that the lightning bolt icon (short cut for running a program) has changed
from grey to yellow  is now available for use.
ii) Click on the lightning bolt icon (run) and your program should run in the normal way (giving
error messages in the bottom part of the split screen if there are syntax errors to fix, otherwise starting
your program running - displaying the prompt Peter told you to use for user input :).
Instead of clicking on the lightning bolt, you can choose the longer route - select Tools and, in its
drop-down menu, Go.

Running from the command line (at the command prompt) (Type exit at the prompt to stop)

  1. With a makefile
i) Get into the Command Prompt screen:
From the drop-down menu for the Windows icon (bottom left corner of screen), select Windows
System, then Command Prompt from its drop-down menu.
ii) Get the correct drive:
If the prompt is say, C:\> and your programming files are on the H drive, type in H: and press
Enter. This should make the prompt change to H:\>
iii) Get the correct location where your files are stored:
To sort out the correct path being in the command prompt, use the change directory command (cd) eg
Type at the prompt cd Users and press Enter. This should make the prompt change to
H:\Users>
You can keep doing this to get to where your files are eg type at the prompt cd jbloggs and
see it change to H:\Users\jbloggs> type at the prompt cd myprogfiles
and see it change to H:\Users\jbloggs\myprogfiles>
OR
You can do it all in one go by typing at the prompt cd Users\jbloggs\myprogfiles and
see immediately
H:\Users\jbloggs\myprogfiles>
iv) Run the make program:
You are now in the place where your programming files, including a makefile, are stored. Type make
at the prompt. make will use the makefile details to compile the programming files (creating 3 .o
files), then to link these into the .exe. It will display what has happened (comments excluded!):
g++ -c assign4.c // The g++ compiler program has compiled assign4.c
g++ -c dir.c // The g++ compiler program has compiled dir.c
g++ -c fat.c // The g++ compiler program has compiled fat.c
g++ -o assign4.exe assign4.o dir.o fat.o
// The g++ linker program has linked the 3 .o files to create the .exe of the name specified in the makefile
If you have edited some (but not all) of your files since last calling make, you will see a subset of the
above (only the commands that needed to be done again).
If you had made no changes to your programming files since last running make, you will see:
make: assign4.exe is up to date.
The prompt will return after each of the above displays.
v) You are now in a position to run your program. At the prompt, type the name of the .exe file,
without the extension assign
The computer runs the .exe, so the next thing you should see is your program running. If you have
programmed as directed by the question, you should see the prompt for user input :
  1. Without a makefile

i) The long way: You can do this one command at a time, checking that the relevant file is created in each case. This involves typing each command in turn at the prompt (the commands that would be in a makefile if you were using one, only compiling first and linking after that). It is a case of doing things manually instead of using a makefile. At the prompt, type successively: g++ -c assign4.c // and press Enter. If you check the list of files, assign4.o has been added g++ -c dir.c // and press Enter. If you check the list of files, dir.o will have been added g++ -c fat.c // and press Enter. If you check the list of files, fat.o will have been added

Compiling of the programming files is complete. For linking these .o files, type at the prompt g++ -o assign4.exe assign4.o dir.o fat.o // and press Enter. ssign4.exe exists

You can now run your program. Type the name of the .exe file, without the extension: assign

The computer runs the .exe. The next thing you should see is your program running. If you have
programmed as directed by the question, you should see the prompt for user input :

ii) The shortcut way: You will get the same result with g++ -o assign4.exe assign4.c dir.c fat.c // and press Enter. If you check the list of files, assign4.exe will have been added. The .o files are not shown using this method. (Created and deleted after linking.)

You can now run your program. Type the name of the .exe file, without the extension: assign
The computer runs the .exe. The next thing you should see is your program running. If you have
programmed as directed by the question, you should see the prompt for user input :
Note: Some problems may be the result of the gcc not being installed with the correct path. This could
particularly be a problem on laptops and computers at home, but may also be a problem in Massey
labs. See Peter if you need the path set up correctly.