#include <ArduinoTrace.h>
enum rainbow {
violet,
indigo,
blue,
green, yellow, orange, red
} colors;
enum class eyecolor:byte {
blue,green,brown
} eye;
class eyes
{
public:
enum color
{
green,
brown,
blue,
azure
};
};
typedef struct { // bitfields
uint32_t month : 4; // 1..12 [4 bits]
uint32_t date : 5; // 1..31 [5 bits]
uint32_t hour : 5; // 00..23 [5 bits]
uint32_t minute : 6; // 00..59 [6 bits]
uint32_t second : 6; // 00..59 [6 bits]
} TimeStamp;
// example
// constexpr int introLineCount = sizeof(intro)/sizeof(intro[0]); // this is calculated at compile time
struct student {
int roll_no;
char grade;
float marks[4]; // Array within the structure
};
student A[ ] = { 1, 'A', { 98.5, 77, 89, 78.5 } }; // this works
//constexpr A[1] = { 1, 'A', { 99.7, 77, 89, 78.5 } };
void setup() {
Serial.begin(115200);
uint8_t test = 0;
DUMP(test);
//test = test == 0 ? 1 : 2;
#include "test_include.h"
DUMP(test);
// Serial.print("size of enum rainbow variable: ");
// Serial.println(sizeof(colors)); // 2
//
// Serial.print("size of enum class eyecolor variable:");
// Serial.println(sizeof(eye)); // 1
//
// Serial.println((int)eye ); // 0 ?????
// Serial.println((int)eyecolor::green); // 1
//
// Serial.println(eyes::blue ); // 2
//struct student {
// int roll_no;
// char grade;
// float marks[4]; // Array within the structure
//};
//
//
// A[4] = { 1, 'A', { 99.7, 77, 89, 78.5 } }; // this works
// Serial.println(A[3].marks[0]);
// Serial.println(A[4].marks[0]);
// // Declaring a structure grades
// struct grades {
// int roll_no;
// char grade;
// float marks;
// };
//
// // Initialize of an array of structures
// struct grades class_record[3] = {
// { 1, 'A', 89.5f },
// { 2, 'C', 67.5f },
// { 3, 'B', 70.5f }
// };
//
//
// Serial.print (class_record[1].marks);
}
void loop() {}