Was just dabbling around with c++ and thought i would host this here, sizeof(object) is useful for arrays and no doubt a bunch of other things.
#include <stdio.h> int main() { double double_array[40]; printf( "size of array :: %d\n", sizeof(double_array) ); printf( "size of double :: %d\n", sizeof(double) ); printf( "therefore items in array = %i\n", sizeof(double_array) / sizeof(double) ); // filling array int counter = 0; do { printf("Counter :: %i\n", counter ); counter++; } while ( counter < ( sizeof(double_array) / sizeof(double) ) ); return 0; }
