Posts by Augusto • 417 points
7 posts
-
1
votes1
answer2918
viewsA: Student Queue. Help in structuring code
In your case you would need to modify the row structure to the following. struct FILA{ int inicio; int fim; Aluno aluno[tamanho]; }; Thus, you will have an array of students where you can add the…
-
2
votes1
answer116
viewsQ: Template error when returning value
I am implementing a class that represents an array using template and dynamic allocation. However, when the +(addition) operator was overloaded, the following build error occurred (only when I try…
-
0
votes1
answer190
viewsA: "HEAP CORRUPTION DETECTED"
Your code has few elements of c++ it is practically using only c. You should try to replace the use of the arrays with Std::string and also use the class for handling fstream header files. This will…
-
12
votes4
answers8023
viewsQ: When to use size_t?
Already research on the subject, but I always end up getting confused. I found a article in English that explains very well some reasons for the existence of the type and how to use it. According to…
-
1
votes1
answer197
viewsA: Why doesn’t my code print?
Your program has some logic errors. I ran it here and found, I think, the main problem why your program isn’t printing out a output. The following occurs when your program enters an if, for example…
-
8
votes1
answer574
viewsQ: Why does a char array support a character like ç and a char variable not?
Even though the char variable only supports ASCII characters, why in the following code it has the normal output when a value is inserted with characters that are not part of ASCII as accented…
-
1
votes1
answer268
viewsA: How to clear buffer in numeric menu when typing strings?
Your case is quite simple. You only need to read the rest of the string. You can use the following code on Else. else { //bad token cin.clear(); string badToken; cin >> badToken; cerr <<…