Тема: Cтворення бази даних за допомогою черги через структуру
Допоможіть мені створити базу даних за допомогою черги використовуючи структуру(через контейнер <queue> не можна). Проблема полягає в тому що я не можу реалізувати введення даних і їх виведення, бо не знаю як звернутися до кожного елемента окремо. Я не знаю чи мій код працює правильно оскільки не можу перевірити виведення даних.
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<math.h>
#include<conio.h>
#include<cctype>
#include<stdlib.h>
#include<cstring>
#include<fstream>
#include<iomanip>
#include<type_traits>
#include<Windows.h>
#include<stdio.h>
#include<string.h>
using namespace std;
struct Factory
{
    char name[50];
    char ownership[50];
    char area[50];
    char workers[50];
    Factory* dali;
};
Factory* first, * element;
void AddNew(Factory* first);
void Show(Factory* first);
bool MyAudit(const char* string)
{
    const char* temp = "0123456789-+.";
    unsigned int number = 0;
    for (int i = 0; i < strlen(string); i++)   //strlen(string) -- функція що повертає розмір рядка 'string'
    {
        if ((i > 0) && (string[i] == '+' || string[i] == '-')) //шукаємо '+' або '-' в рядку 'string'
        {
            return false;
        }
        if (string[i] == '.') //шукаємо крапку 
        {
            number++;
            if (number > 1) //перевіряємо чи не більше однієї крапки в рядку
            {
                return false;
            }
        }
        if (strchr(temp, string[i]) == 0) //ми перевіряємо наш рядок 'string' на цифри і на "+-."
        {
            return false;
        }
    }
    return true;
}
void main()
{
    first = NULL;
    int size = 0;
    bool index = false;
    while (index != true)
    {
        cout << "\t Menu: \n";
        cout << "1.View the list of factorys\n";
        cout << "2.Add a new factory\n";
        cout << "3.Exit\n";
        cout << "---------------\n";
        cout << "Enter the number" << endl;
        int menu;
        cin >> menu;
        system("cls");
        switch (menu)
        {
        case 1:
        {
            Show(first);
            system("cls");
            break;
        }
        case 2:
        {
            AddNew(first);
            system("cls");
            break;
        }
        case 3:
        {
            index = true;
            break;
        }
        default:
        {
            cout << "A non-existent menu item is selected\n";
        }
        }
    }
}
void AddNew(Factory* first)
{
    char a[50];
    char b[50];
    char c[50];
    char d[50];
    cout << "Enter the factory name: ";
    cin >> a;
    cout << "The types of property: N - national, P - private, C - cooperative";
    cout << "\nEnter the type of property: ";
    cin >> b;
    cout << "Enter the area of land(hectares): ";
    cin >> c;
    while (MyAudit(c) != true)
    {
        cout << "\nError! Enter a correct value: ";
        cin >> c;
    }
    cout << "Enter the number of workers: ";
    cin >> d;
    while (MyAudit(d) != true)
    {
        cout << "\nError! Enter a correct value: ";
        cin >> d;
    }
    element = new(Factory);
    element->dali = first;
    first = element;
    strcpy(element->name, a);
    strcpy(element->ownership, b);
    strcpy(element->area, c);
    strcpy(element->workers, d);
}void Show(Factory* first)
{ 
}
 аж чай носом пішов.