5 つの円の配列に乱数を設定する際の問題について教えてください。乱数は円の半径になります。これが私のコードです:
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
// Array 2, below section is to populate the array with random radius
float CircleArrayTwo [5]; // store the numbers
const int NUM = 5; // Display 5 random numbers
srand(time(NULL)); // seed the generator
for(int i = 0; i < NUM; ++i)
{
CircleArrayTwo[i] = rand()%10;
}
cout << "Below is the radius each of the five circles in the second array. " << endl;
cout << CircleArrayTwo << endl;
system("PAUSE");
return 0;
}
現在、次のように出力されます。
以下は、2 番目の配列の 5 つの円のそれぞれの半径です。002CF878
どこが間違っていますか?
どんな助けでも大歓迎です