User Tools

Site Tools


notes:discrete:fall2023:projects:ttb0

This is an old revision of the document!


TTB0

STRUCT

A structure is an always-public class. For this project, we'll be using one to group together the code we need for our Breakout brick.

Format the code similarly to a class:

struct Brick {
    int positionX;
    int positionY;
    ...
};

Remember that for structures, a semicolon is needed after the closing curly brace. You'll get an error otherwise.

POINTERS

MALLOC

MALLOC’ED ARRAY

ACCESSING WITH POINTER ARITHMETIC

MALLOC’ED ARRAY OF STRUCTS

notes/discrete/fall2023/projects/ttb0.1694625184.txt.gz · Last modified: 2023/09/13 17:13 by walley