Тема: Решенные задания
Подправил пару ошибок, провери все работает.
С динамическим выделением памяти (кстати тут тоже были ошибки)
#include <iostream>
using namespace std;
struct Queue
{
int Age;
char Sex;
};
Queue* fuller (Queue* InpQueue)
{
InpQueue->Age = 17;
InpQueue->Sex = 'm';
return InpQueue;
}
void main()
{
Queue *Id = new Queue;
Id = fuller(Id);
cout<<Id->Age<<endl<<Id->Sex;
delete Id;
}Без дин. памяти.
#include <iostream>
using namespace std;
struct Queue
{
int Age;
char Sex;
};
Queue* fuller (Queue* InpQueue)
{
InpQueue->Age = 17;
InpQueue->Sex = 'm';
return InpQueue;
}
void main()
{
struct Queue arg;
arg = *fuller(&arg);
cout<<arg.Age<<endl;
cout<<arg.Sex;
}