Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
struct Point
{
double x, y;
};
struct Trial
{
double stime, etime;
Point *ways;
int numways;
};
struct Subject
{
string name;
int id;
Trial pre, post;
};
Subject S;
Subject* A;
int i, j;
| expression | type |
S.id | |
A[i] | |
A.pre.ways[i][j] | |
S.post = A[i].pre; | |
A[i].post.ways | |
S.pre.ways[i] | |
A[i].id = S.ways[i].y | |
A[i].pre.ways[j].x | |
A[i].post.ways.x | |
S.pre.numways++ |
Suppose we have the structs defined below, and
variable V assigned and initialized as shown
in the picture.
struct Pos
{
int row, col;
};
struct Guy
{
char sym;
Pos loc;
};
struct Group
{
Guy *peeps;
int num;
};
Write a statment(s) that:
void read(istream& in, DivBox &DB);needs a definition. All you have to do is add that definition! The only point here is that you have to deal with composed structs, i.e. structs containing structs containing structs. Here's the format you'll be reading in.
color
width r g b
| | | |
new (20,100) 100x50 255,0,0 filled
| | | |
x y height aleternative is "hollow"
point
Note: submit a printout of your .cpp file and a
printout of the browser rendering of the tst.html produced by
your program on the input file
hwin2.txt.