|
C M S C 1 1 4 C o m p u t e r S c i e n c e I S p r i n g 2 0 0 4 |
See the project #4 email (read through the first part of it as it discusses this issue) and also the project #5 FAQ for further information.
Yes. They are special "helping" functions that the copy ctor, the dtor and the operator= functions can use. If you examine these three functions they have some similarities which you can "extract" and put into the "copy" and "free" functions. NOTE: not all three of those special functions (copy ctor, dtor, operator=) will need to use the free function and not all three will need to use the copy function.
No. The name member is a C++ style string (which you are thus allowed to use on this project) and it manages its "internal memory" *automatically* for you and thus you do not have to worry about it at all. If you want to learn more about C++ style strings you can read chapter 15 of the text as it contains a wealth of information on them.
Be careful when submitting to make sure:
NOTE: it is easy to inadvertantly (by mistake) delete a file or two by incorrectly setting up your makefile (for example using -o with the cxx compiler in the wrong way) and/or by misusing the tar command. THUS IT IS STRONGLY RECOMMENDED THAT YOU MAKE A BACKUP COPY OF YOUR FILES ON A REGULAR BASIS into a subdirectory.
Meaning delete any old executable files (like a.out) and delete the cxx_repository directory (if it exists). See project #2 FAQ for more detailed information about quota and other related items.
Project #4 is due by 11PM on Thursday, April 1st, 2004. As always, students should strive to submit a working project that passes primary one or more days "early" and then finish up any last minute special case testing and "cleaning up of code" and submit the final "polished" version the day the project is due.
Again this requires explaining several things. The first is "what is a shell"? Answer - a special program which allows users of the computer to "interact" with the kernel. So what is the kernel? It is basically the actual operating system itself.
So in its most basic form the shell is the interface for you, the user of the operating system, to be able to interact with it - by giving commands to it - at the UNIX shell prompt.
There are a number of different shells available for you to use on most UNIX systems - each will be similar in many ways, but each will have their own unique features which may or may not make them look "attractive" to use. The following is a list of SOME of the possible (and more common) shells that you could use:
To "run" any of the shells above just type the shell command at the UNIX prompt. For example to run the Bourne shell type sh at the UNIX prompt and what happens is that a new prompt appears (and is generally a dollar sign) - then type ls and see what happens - when done using the shell type exit and it will take you back to your "old" shell (which was left running in the "background"). Try this with the other shells. NOTE if you are in the Bourne shell you can start ANOTHER Bourne shell by typing sh again - be careful however because it LOOKS like nothing happened - BUT IT *DID* start another shell - type exit and it will leave this shell and return you to the other one - the problem is both prompts look the same - type exit again and it will send you back to the first shell.
To find out more about a shell you can do some research on the internet, purchase a UNIX book, or check on the man page (man tcsh).
What follows is some on "customizing" your shell and changing the "default shell" that is run when you log in.
Each shell has a set of "shell variables" which you can create, change, or delete - these shell variables help you control your "shell environment" and affect the way it works. BE VERY CAREFUL DOING ANY OF THE FOLLOWING THINGS BECAUSE IF YOU DO THEM INCORRECTLY THEY CAN CAUSE YOUR ACCOUNT TO NO LONGER WORK. To see all of the current shell variables type the command set at the UNIX prompt.
For example: When you are using the csh or tcsh shells you can customize the prompt by typing set prompt = " Welcome % " and that changes the way the prompt appears. If you are using the tcsh shell (which by default your class accounts are after you have run the setup program for project #0) you can set the prompt to the following: set prompt = "[%n@%m] %~ %% " Note however that this only works if you are using the tcsh shell (this is very common that certain things will only work in certain shells and so you have to learn more about each specific shell. There are many differences and "little things" that the different shells can do - way to many to write about here.
One last item - if you modify your prompt you will notice that the next time you log in it goes back to the "default prompt" - and you have to manually reset it each time - there is a special file for most shells that gets run automatically each time you start up a shell (similar to your .login that gets run ONCE each time you log in - and never again). For the tcsh and csh shells this special file is your .cshrc file and each time you start up a csh or tcsh shell this file (.cshrc) is "run" and it helps to allow you to customize your shell. If you put the set prompt = "Enter Command: " on a line by itself in the .cshrc file you will see that the next time you log in the prompt will get set to this "customized" prompt.
BE VERY CAREFUL IF YOU MODIFY YOUR .cshrc (or any other hidden file) BECAUSE IF YOU DO SO INCORRECTLY IT MAY CAUSE YOUR ACCOUNT TO STOP WORKING COMPLETELY - thus it is a good idea to back them up before you modify them and to not do this right before a project is due as no extension will be granted due to related problems.
One last item - if you want to change the system so that it uses a different shell (besides tcsh) when you log in DO NOT MODIFY YOUR .login file - this is NOT the way to do this. What you have to do is run the chsh command (the change shell command) - BE VERY CAREFUL IF YOU RUN THIS COMMAND and you should check the man page (man chsh) and read it thoroughly and also look in the file /etc/shells which usually exists and lists the shells that you could use. AGAIN DO NOT RUN THIS (chsh) COMMAND UNLESS YOU ABSOLUTELY KNOW WHAT YOU ARE DOING BECAUSE IF YOU DO THIS INCORRECTLY AND PUT DOWN THE WRONG SHELL THE NEXT TIME YOU LOG IN, YOUR ACCOUNT *****WILL NOT***** WORK. If you really want to do this, find someone who has done this before to help you out (and as always log out and log back in to test it - NOTE that on some systems it may take up to a day for this to take effect - similar to running the chfn command to change your finger information).
|
See the class syllabus for policies concerning email Last Modified: Mon Apr 12 14:05:14 EDT 2004 |
|
|
|
|
|