3
EDIT: Problem solved, after changing much of the code, not only in the functions mentioned here, the error stopped occurring.
I’m getting this mistake and I have no idea what might be causing it, I’ve never seen it before. Any hint about the cause of the error?
After clicking Break the code that appears is this:
_CRTIMP PFLS_GETVALUE_FUNCTION __cdecl __set_flsgetvalue()
{
#ifdef _M_IX86
PFLS_GETVALUE_FUNCTION flsGetValue = FLS_GETVALUE;
if (!flsGetValue)
{
flsGetValue = DecodePointer(gpFlsGetValue);
TlsSetValue(__getvalueindex, flsGetValue);
}
return flsGetValue;
#else /* _M_IX86 */
return NULL;
#endif /* _M_IX86 */
}
The error occurs when arriving at this part of the code:
void imprime_vertices(head* h)
{
int i, n;
n = (h[0]).grau;
for(i = 1; i <=n; i++){
printf("%d %d %d\n", h[i].vertice[0], h[i].vertice[1], h[i].vertice[2]);
}
printf("\n");
}
When the error occurs and you press "Break", what is the information in the call stack window (call stack)? It can give a good indication of where the error lies. If you have questions about the code in the indicated location, do not forget to edit the question to include it, otherwise it is very difficult for someone to help. :)
– Luiz Vieira
Updated. @Luizvieira
– Talles
Ok. :) Sorry if the question seems too basic, but you came to debug its function
imprime_vertices
to see if (1) the pointerh
is properly allocated and (2) the degree of the vertex is consistent with the number of edges? By the way, why do you print three values for each edge on the vertex? Without knowing its data structure, I would imagine that if they are fixed they should be two identifiers (of the current vertex and of the other to which the edge connects).– Luiz Vieira
I will debug yes, the error is in Visual Studio itself, since compiling and running in the terminal the code runs normally.
– Talles
I don’t think the error is "in Visual Studio". Maybe the error is happening and your program ends without you noticing. VS is only warning you because in it you run in debug mode. Take a look at the existing answer. She has an important tip related to what I was commenting on.
– Luiz Vieira
This question seems to be decontextualized because it is about a very specific author coding error, which will hardly be useful to other people in the community (at least in the current format of the question).
– Luiz Vieira