struct
How to pass a C++class (structure) template to a function template
There is a structure template
template<typename T>
struct spec
{
T* values;
int size = 0;
};
You need to make ... ze] = val;
st->size = st->size + 1;
}
But the error is отсутствует список аргументов для параметр шаблона template
Random selection of the file to read
I am trying to pass a random value( file name from enum) to a parameter for the file read method. But it throws an OptinalVal ... (name: TaskName.LvlTwo.allCases.randomElement()!, type: "txt")
let conentFile = content
lebel.text = contentFile!
}
Calculating the average, maximum, and minimum age in c++
I don't understand what the error is.
Outputs:
struct StatisticVisitors
{
public:
string surename[255];
};
void Stat ... erageAge;
cout << "\nold: " << maximumAge;
cout << "\nyong: " << minimumAge << "\n";
}
Create an array of structures with students in C
When creating a function that adds students to an array of structures, it highlights them in red.
Here is the entire code
# ...
student res_st;
scrcpy_s(res_st, 50, name);
}
Why can't I create the addStudent function? Thank you in advance.
Parsing dbf files with Python
I want to use data from KLADR in one of the projects. Since the data will have to be updated, I want to make a tool that will ... eive:
struct.error: unpack requires a bytes object of length 8
What am I doing wrong? What is the format of a 32-bit number?
Problem when creating the struct.pack package()
I need to create a package for the Minecraft server (more on this https://minecraft-ru.gamepedia.com/Server_classic protocol) ...
How can this be fixed? Thank you in advance
Upd: I forgot to tell you that I'm building the "Player Identification" package
Typed files. How to read information from a file?
Hello, please help me solve the task: Write a program containing information about the institute's employees. Each structure ... [n];
ifstream listOW("listOfWorkers");
while (listOW.getline(text, m)) // Далее не пойму что делать.
return 0;
}
C++ Structure. use of deleted function operator=
// menu.h
struct MenuParameter {
String textBefore;
unsigned int &value;
String (&valueFormatter)(unsigned ... deleted because the default definition would be ill-formed:
struct MenuParameter {
Why does this occur and how to avoid it?
golang reflect access to structure fields
There is such a structure:
type User struct{ID string}
u := &User{}
How can I get the name of the field - "ID" from u. ... ture, the numbering will be broken. To pull out means to get the name of this property, but the wording is not quite correct.
Dynamic structures in c++
I'm going through a task in Alex Elline's book. After the topic of pointers and links in one of the test tasks, he asks you t ... ;< '\n' <<
my_people[i].health << '\n';
}
delete[] my_people;
system("pause");
}
Transmission of the structure via HRF24L01 in the Smart Home system
There was a need to transfer the structure through the NRF24L01 module to the Arduino, and then there were new problems. I wi ... t me as the module ID and the ego type can always be different. It is the data substitution that is needed.
Help Meeeee!!!!
Error: "Breakpoint triggered"
There is a program: reads data from a file to a string, parses it by ";", writes it to a string vector, then converts the dat ... << pgn[i - 1].x << " - " << pgn[i].y << endl;
}
}
else{
cout << "Open error!";
}
}
Checking Code match on a vector inside a struct in C
Next, I created a struct
struct eventos
{
int codigo;
char data[11];
char atracao[50];
int ingresso;
f ... lting the first and the second listed as not registered event.
If you can help me with any way out, I will be very grateful!
How to connect one struct on the other?
I started in programming in C not long ago and I am with a doubt regarding structs, I would like to know if it is possible to ... ere a way to link the codigo_categoria member of struct categoria with the codigo_ligacao_categoria member of struct produto?
Struct vector in C
I can't find the error in this code of mine from an exercise. It prints right the first read, then prints random things. I co ... printf ("Posicao no seu TOP 5: %d \n",banda[i].posicao);
}
}
Am I iterating wrong in reading? How would it be right ?
strcpy () in struct string
I have a struct Time that has a Vector char name[30], the problem starts when I try to copy a value to this string with the ... "Palmeiras");
time *t = c.first;
printf("%s", t->name);
return 0;
The value of print for t->name is always garbage.
Struct and chained list
I created a structure of type person and intend to use it in a chained list, but the following errors appear:
' No ' ha ... ão achei necessário colocá-la
}
void destruirLista(Lista *l)
{
//já está pronta, porém não achei necessário colocá-la
}
Binary file storage
In the program, I need to implement a structure that represents a student (name, age and enrollment). Using this structure, I ... would like to know why this is happening and I would also like to know if this method of storing in a binary file is correct.
How to manipulate a structs vector in an external function? Follow example
I'm in doubt on a question. The following statement follows:
Implement a library control system with functions to register, ... int paginas;
};
I would like to know how to pass a vector of this struct as a parameter of a function, can anyone help me?
Problem in ordering insertion code of structs (records) in files
I'm doing a job where I have to insert structs alphabetically into files, where the structs are political and the files (whic ... rename("newfile.txt", sigla); //Renomeia o novo arquivo de modo que este fique com o nome do arquivo antigo.
}
}
}