int SomeValues[2] = {1, 2};
somevar = *(SomeValues + 1) ;
int SomeValues[2] = {1, 2};
somevar = SomeValues[1];
-Iron Eye
Cyrus Eye design _//_ My personal site _//_ Google
"Games usually keep me from making my own..."
int SomeValues[2] = {1, 2};
somevar = *(SomeValues + 1) ;
int SomeValues[2] = {1, 2};
somevar = SomeValues[1];
quote:Original post by Iron EyeYou''ll find it very diffucult to copy an array. An array is nothing more than a pointer to a variable of the array''s type, plus that the compiler takes care of allocating and freeing the memory block. With an array, you cannot pass-by-value, in the sense that the value is the array''s content. The value of your array identifier is a pointer.
Other than,say if you were in some sort of external function you wouldnt need to make a copy of the array?
some_type a[100]; // no difference; it''s the exact same thingsome_type b = a[50];some_type b = *(a + 50); // This will be slowerchar str[] = "24452ACF";int pos = 0;while(str[pos]) { if(str[pos] >= ''1'' && str[pos] <= ''9'') pos += str[pos] - ''0'' + 1; if(str[pos] >= ''A'' && str[pos] <= ''Z'') pos -= str[pos] - ''A'' + 1;} // Than thischar str[] = "24452ACF";while(*str) { if(*str >= ''1'' && *str <= ''9'') str += *str - ''0'' + 1; if(*str >= ''A'' && *str <= ''Z'') str -= *str - ''A'' + 1;}
But, they both should probably be structured, so that it had less of an inpact.