добавление наработок

This commit is contained in:
Dmitry Borisenko
2022-08-25 17:33:07 +02:00
parent 6822bdf532
commit a4b7eb00d7
15 changed files with 360 additions and 176 deletions

42
training/QueueFromChar.h Normal file
View File

@@ -0,0 +1,42 @@
#pragma once
#include "Global.h"
#ifdef QUEUE_FROM_CHAR
#define MAX_COMMAND_LENGTH 16
#define BUFFER 128
class QueueFromChar;
class QueueFromChar {
public:
QueueFromChar();
~QueueFromChar();
void addCommand(const char* command);
void printCommands();
String getLastCommand();
private:
struct CharBufferStruct {
char command[MAX_COMMAND_LENGTH + 1];
};
CharBufferStruct* commandList;
int commandCount = 0;
};
// extern QueueFromChar* myBuf;
//========проверка очереди=====================
// myBuf = new QueueFromChar;
// myBuf->addCommand("zero");
// myBuf->addCommand("one");
// myBuf->addCommand("two");
// myBuf->printCommands();
// myBuf->getLastCommand();
// myBuf->getLastCommand();
// myBuf->getLastCommand();
// myBuf->printCommands();
#endif