cpsc 213

  1. How do you allocate a dynamic array of object "int x" and of size "n"?
    (x*)malloc(n*sizeof(x));
  2. what might a constructor for the C code look like?

    //Point
    typedef struct{
        float x;
        float y;
    } Point;
    • void construct_point(Point* point, float newX, float newY){
    •     point->x = newX;
    •     point->y = newY;
    • }
  3. Left shift by k bits, x << k =
    x*2
  4. x >> k =
    x/2k
  5. 1 byte =
    8 bits
  6. a static variable's storage is allocated...
    before the program starts
  7. a dynamic variables storage is allocated...
    during the program execution
Author
Anonymous
ID
203949
Card Set
cpsc 213
Description
assembly code, C, Computer Systems
Updated