Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Arrays in C++

Name: Anonymous 2012-11-12 21:48

So lets say I have an array, int array[3] = {123, 456, 789}.
If I wanted to take the first number of each value of the array and store it in another array, say int first[3];, how would I do that? I tried using a pointer to read the first memory address of each value of the array but it keeps returning the full array.

Name: Anonymous 2012-11-12 23:08

>>13
lol no.
for (int i : array) {
  int n = 1;
  while (i/n > 0) n *= 10;
  std::cout << n;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List