Error in Visual Studio [closed]

3

EDIT: Problem solved, after changing a lot of the code, not only in the functions mentioned here, the error stopped.

I'm getting this error and I have no idea what might be causing it, I've never seen this error before. Any tips on the cause of the error?

AfterclickingBreakthecodethatappearsisthis:

_CRTIMPPFLS_GETVALUE_FUNCTION__cdecl__set_flsgetvalue(){#ifdef_M_IX86PFLS_GETVALUE_FUNCTIONflsGetValue=FLS_GETVALUE;if(!flsGetValue){flsGetValue=DecodePointer(gpFlsGetValue);TlsSetValue(__getvalueindex,flsGetValue);}returnflsGetValue;#else/*_M_IX86*/returnNULL;#endif/*_M_IX86*/}

Theerroroccurswhenyougettothispartofthecode:

voidimprime_vertices(head*h){inti,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");
}
    
asked by anonymous 05.07.2014 / 21:45

1 answer

3

Using i as an array index, this seems wrong

for(i = 1; i <=n; i++)
// h[0] nao acedido
// tentativa de aceder a h[n], que nao existe???

Arrays, in C, will range from% to% with index 0 . The canonical way of writing a cycle that cycles through all the elements of an array is

for (i = 0; i < n; i++)
    
09.07.2014 / 11:50