Skip to content
Writing Code > Variables

Variables

Edit This Page
Description: Compiled Cherno videos for you to learn from!

Variable Video Explanation:


Simplified Variable Reference Sheet:

Type NameKeywordSize (Bytes)Size (Numerical)OperationsConventional interpretation
Void / Null / Nonevoid00NoneThe idea of nothing in code form. Example: void functionName(/*params*/);
Integerint4 BytesMax: 2147483647 Min: -2147483648*, /, +, -, %Whole numbers without decimals (like math integers).
Floating Point Numberfloat4 BytesMax: 3.40282347e+38 Min: 1.17549435e-38 Also: inf, -inf, NaN*, /, +, -, %Decimal numbers. VEX brains typically use floats, so doubles are rarely needed.
Characterchar1 Byte0 to 255*, /, +, -, %Represents a character using ASCII-like encoding. See Extended ASCII.

Constant Keyword (const):


Example of the const keywords in a Vex Project!

Source can be found here.

// Structure that stores physical properties about a robot (These don't normally change)struct PhysicalProperties{  // Note: full variable names!  //* Physical Size of robot  const float drivelength;  // In inches  const float drivewidth;   // In inches    //* Useful Physical Information  const float trackwidth;   // In inches  const float tracklength;  // In inches  //* Important Wheel Characteristics  const float gearing;        // Scalar  const float wheelDiameter;  // Diameter of wheel  // Total Amount of Motors on Drivetrain  const float motorWattage;  // Wattage of motors  // Theoretical maximum values   // (These can be computed from the variables, but are commonly used so it's worth caching them)  const float maxVelocity;  // Max Velocity of Drivetrain  const Angle<Radians> maxAngularVelocity;  // Max angular velocity of drivetrain    /* Constructor Omitted to Shorten Codeblock */  // This would assign values to the variables inside the struct};

static Keyword:



Not an AD: Please add more to these things, people be confused. Contribute today! 😄