Answer the question
In order to leave comments, you need to log in
How does this feature work?
There is a code that has questions
#include <iostream>
#include <fstream>
using namespace std;
void insert(list*& p, char value);
struct list
{
char symbol;
list* next;
};
int main()
{
setlocale(LC_CTYPE, "Russian");
list* first = nullptr;
char value;
cout << "Введите символ ";
cin >> value;
insert(first, value);
}
void insert(list*& p, char value) //
{
list* newP = new list;
if (newP != NULL) //есть ли место?
{
newP->symbol = value;
newP->next = p;
p = newP;
}
else
cout << "Операция добавления не выполнена" << endl;
}
Answer the question
In order to leave comments, you need to log in
Questions should be asked to the developer of this code, because the general answer to all 3 points is because the code is written that way. The background is unknown.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question