I simplified the code for just so it's easeir to understand. 'a' is an array, made up of 2 integers and 3 strings, n is of course an integer. The problem is that the result that's shown on screen is an overflown integer witha value of -863838, the usual stuff. I think i screwed up the addition syntax, because i'm uisng visual studio 2013, but used the 2015 version before that.
Also do not mind that the code is missing a few things, this is just a portion.
1 2 3 4 5 6
n = 0;
for (i = 0; i < db; i++)
{
n=n+a[i].n;
}
cout << n;