Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
38 строки
1.0 KiB
C++
38 строки
1.0 KiB
C++
#ifndef LAB04_H_INCLUDED
|
|
#define LAB04_H_INCLUDED
|
|
|
|
#include <iostream>
|
|
#include <iomanip>
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
#pragma once
|
|
|
|
void print_in_hex(uint8_t byte);
|
|
void print_in_hex(const void* data, size_t size);
|
|
void print_in_binary(uint8_t byte);
|
|
void print_in_binary(const void* data, size_t size);
|
|
uint16_t perform_bitwise_operation(uint16_t operand1, char operation, uint16_t operand2);
|
|
void print_calculation(uint16_t result);
|
|
|
|
// Student
|
|
struct Student {
|
|
char name[17];
|
|
uint16_t admissionYear;
|
|
float averageGrade;
|
|
unsigned int gender : 1;
|
|
unsigned int completedCourses;
|
|
Student* groupLeader;
|
|
|
|
// Initialisation
|
|
Student(const char* n, uint16_t year, float grade, unsigned int g, unsigned int courses, Student* leader)
|
|
: admissionYear(year), averageGrade(grade), gender(g), completedCourses(courses), groupLeader(leader)
|
|
{
|
|
strncpy(name, n, sizeof(name) - 1);
|
|
name[sizeof(name) - 1] = '\0';
|
|
}
|
|
};
|
|
|
|
void printStudentDetails(const Student& student);
|
|
|
|
#endif // LAB04_H_INCLUDED
|