Memory - Programming Paradigms - Prof. Cain, Study notes of Programming Paradigms

Introduction to computer science. Handout of Programming paradigms. Memory - Prof. Cain - Stanford University

Typology: Study notes

2010/2011

Uploaded on 10/17/2011

larryp
larryp 🇺🇸

4.8

(34)

352 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ty p e d ef struct {
char *name;
c h ar suid[8];
int numUnits;
} student;
st u d e nt friends[4];
friends[0].na me = frie n d s[2].suid + 3;
friends[5].n u m U nits = 21;
strcpy(frien d s[1].s uid , "4041554");
strcpy(friends->nam e, "Tiger Woods");
strcpy((char *) &frien d s[ 0].num U nits, (const char *) &frie nds[2].nu m U nits);
pf3
pf4
pf5
pf8

Partial preview of the text

Download Memory - Programming Paradigms - Prof. Cain and more Study notes Programming Paradigms in PDF only on Docsity!

truct

char *name;char su

id[8]

int numUn

its; ; friends[

];

[0].name = f

riends

[2].su

id + 3

[5].num Uni

ts = 21

friends[

].sui d,^ "4041554"

friends->name, "T

iger Woods")

(char *

) &friends[

].num Uni

ts,^ (cons

t char

*) &f riends[

].numUni

ts);

truct{ char *name;char su

id[8]

int numUn

its; ; friends[

];

[0].name = f

riends

[2].su

id + 3

[5].num Uni

ts = 21

friends[

].sui d,^ "4041554"

friends->name, "T

iger Woods")

(char *

) &friends[

].num Uni

ts,^ (cons

t char

*) &f riends[

].numUni

ts);

truct{ char *name;char su

id[8]

int numUn

its; ; friends[

];

[0].name = f

riends

[2].su

id + 3

[5].num Uni

ts = 21

friends[

].sui d,^ "4041554"

friends->name, "T

iger Woods")

(char *

) &friends[

].num Uni

ts,^ (cons

t char

*) &f riends[

].numUni

ts);

truct{ char *name;char su

id[8]

int numUn

its; ; friends[

];

[0].name = f

riends

[2].su

id + 3

[5].num Uni

ts = 21

friends[

].sui d,^ "4041554"

friends->name, "T

iger Woods")

(char *

) &friends[

].num Uni

ts,^ (cons

t char

*) &f riends[

].numUni

ts);

\

truct{ char *name;char su

id[8]

int numUn

its; ; friends[

];

[0].name = f

riends

[2].su

id + 3

[5].num Uni

ts = 21

friends[

].sui d,^ "4041554"

friends->name, "T

iger Woods")

(char *

) &friends[

].num Uni

ts,^ (cons

t char

*) &f riends[

].numUni

ts);

\

T

i^ g

e^

r

W^

o^ o

d^ s

\

W^

o^ o

d^ s

\

typedef s

truct{ char *name;char su

id[8]

int numUn

its;

} student

student

friends[

];

friends

[0].name = f

riends

[2].su

id + 3

friends

[5].num Uni

ts = 21

strcpy(

friends[

].sui d,^ "4041554"

strcpy(

friends->name, "T

iger Woods")

strcpy(

(char *

) &friends[

].num Uni

ts,^ (cons

t char

*) &f riends[

].numUni

ts);

*(char *

((frac

tion *

)friends)

[3].denom)) = &fr

iends

[0].name + 1

\

T

i^ g

e^

r

W^

o^ o

d^ s

\

W^

o^ o

d^ s

\

typedef s

truct

int num;int denom; }frac

tion;