Monday, March 03, 2008

Some class notes

1 4 6 8 5 32 0 -1
1 4 6 8 5 3 2 0 -1
1 8 2 4 5 0 6 3 -1
int list[10];cout list[k];
address(list[k]) = address(list[1]) + (k-lowerbound)*el_size= address(list[1])- lowerbound*el_size + k*el_size
descriptor for arrays_________arrayelem typeindex type# of dimensionsindex upper boundindex lower boundaddress
// using ] in place of greater than because of html%salaries = ("Cedric" =] 75000, "Perry" =]56000);$salaries{"Perry"} = 70000;$s = "Josh";$salaries{$s} = 8000;if exists $salaries{"Shelly"}delete $salaries{"Perry"};%salaries = ();
01 EMPLOYEE-RECORD 02 EMPLOYEE-NAME 05 FIRST PICTURE IS X(20) 05 MID PICTURE IS X(20) 05 LAST PICTURE IS X(20) 02 HOURLY-RATE PICTURE IS 99V99
01 employer-record 02 employer-name 05 FIRST PICTURE IS X(20) 05 LAST PICTURE IS X(20) 05 SSN PICTURE IS X(20)
FIRST OF EMPLOYEE-NAME OF EMPLOYEE-RECORD
FIRST OF EMPLOYEE-RECORD
STRUCT A{ STRUCT B { INT X; INT Y; } J; CHAR Z; } H;
H.J.X
class a{ int i; char * p; string g; a() { p = new char [60]; ~a() { delete [] p; }};
a b, c;
b = c;
b.g = c.g;
move corresponding employer-record to employee-record
dynamic variables as discussed in the papermain(){ int x, y; int z; set z : int = x -4 in { foo(); bar(); } bar();}
foo(){ int a, b; use z : int in { cout z;
}}
bar(){ int q; set z : int = q -4 in { foo(); }}

No comments: