Question

Draw the pictures representing each of the declarations below.   These problems build on each other, so...

Draw the pictures representing each of the declarations below.  

These problems build on each other, so in some cases a picture refers to something previously created.

/* Lab 13: Picture Dynamic Memory

Objective: Draw Pictures of Computer Memory

*/

#include<iostream>

using namespace std;

int main() {

// A.

int numbers[5];

//-------------

// B.   

char words[3][10];

//----------------

// C.

int *pNumbers = new int[4];  

//-------------------------

// D.

char **pWords;

pWords = new char*[3];

for( int i=0; i<3; i++) {

pWords[i] = new char[5];

}

//---------------------------

// E.

//Assume we have:

class Student{

public:

Student(){

initials[0] = 'D';

initials[1] = 'F';

initials[2] = 'R';

UIN = 12345;

}

private:

char initials[3]; // Delano Franklin Roosevelt would be DFR

long UIN;

};

// Now draw the following:

Student cs141[3];

Student *pStudent = &cs141[2];

Student *pOther = pStudent;

//--------------------------------------

//F.

//Assume we have:

struct Node {

int data;

Node *pNext;

};

// Now draw the following:

Node n1;

n1.data = 3;

Node *pNode = new Node;

pNode->data = 5;

pNode->pNext = &n1;

pNode->pNext->pNext = pNode;

///======================================

return 0;

}

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Draw the pictures representing each of the declarations below.   These problems build on each other, so...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I have a C++ code that lets me enter, display and delete a student record. I...

    I have a C++ code that lets me enter, display and delete a student record. I need to implement a function that prints the average grade score of the students I input. Below is my code and a picture of how my code looks right now. #include<iostream> #include<stdlib.h> using namespace std; //Node Declaration struct node {    string name;    string id;    int score;    node *next;   }; //List class class list {        private:        //head...

  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

  • I can't figure out the formula for each one? Home Insert Draw Page Layout Formulas Data...

    I can't figure out the formula for each one? Home Insert Draw Page Layout Formulas Data Review View 2 E E N DO E Get Add-ins G?- c rv - the slicer e Timeline Link New Comm Plvot Table Recommended Table Pictures Shapes Icons My Add-ins v Recommended 0 vN Maps PivotChart Sparklines Pivot Tables Charts 015 , X fx ACDEFGHIJKLMNOP T U Problem 1: Bernoulli's equation relates the pressure and velocity of a fluid. It states: p+50V2 + pgh...

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT