CS2401 Lab Assignment 3


Category: You will Instantly receive a download link for .zip solution file upon Payment


5/5 - (5 votes)

Part One: (Static and automatic variables.)
1. If you have not already done so, make a directory for your CS2401 stuff
mkdir cs2401
// I’m pretty sure that most of you have already done this
2. Go into that directory
cd cs2401
3. Once you are in there make a directory for your labs and inside that one a directory for lab3.
4. Open a new file in your favorite editor, #include and put in your
using statement.
5. Type in this little function:
void pretty( ){
int x = 0;
for(int i = 0; i < x; ++i){ cout<<’*’;} cout< and the
using namespace std; – this time you will only need a main
2. Declare a pointer capable of pointing at an int. (int * ptr; )
3. Make the pointer point at a new integer. (ptr = new int; )
4. Print out the address of the new integer. (On your answer sheet write how you did this as well as the address that shows up.) (cout << ptr <