How in the world, are they getting these results!?! I see that n=0 and a.n refers to that value (static int). Is b[5] and array that holds five values? If so, how does "a.n" become 7? And how then, does CDummy::n = 6?

When you declare a data member static there is a single copy of that data member used by all instances of the class so a.n and CDummy::n refer to the same variable.

CDummy::n is incremented every time a class is constructed and decremented when the class is destroyed. So the first cout 7 classes have been created, a, the 5 in the array b and the one newed that c points to, the constructor has been called 7 times and CDummy::n incremented 7 times from 0 to 7.

The c is deleted, the destructor is called and n is decremented so at the next cout CDummy::n has a value of 6 (7 - 1).

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...