Validate Frame Size

#include <iostream>
#include <cstdint>
using namespace std;
 
// Define struct Frame here
struct Frame {
    uint16_t header;
    uint8_t command;
    uint8_t length;
    uint8_t payload[6];
    uint16_t checksum;
};
 
static_assert(sizeof(Frame) == 12, "Frame size mismatch");
 
int main() {
    cout << "Frame OK";
    return 0;
}
Upvote
Downvote
Loading...

Input

Expected Output

Frame OK