Sep 13, 2013 at 9:14pm UTC
It's working as intended. Trust me
Sep 13, 2013 at 9:31pm UTC
I keep getting error messages though
Sep 13, 2013 at 9:36pm UTC
Lol, I'm just messing with you.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <iostream>
using namespace std;
int main()
{
const int arraySize = 25;
const int patternSize = 10;
int arr1[arraySize] = {0,1,2,3,4,5,6,7,8,9};
for (int i=0; i<arraySize; i++)
{
cout << arr1[i%patternSize] << " " ;
}
system("PAUSE" );
return 0;
}
use this.
I have zero clue why you're using that new operator.
Last edited on Sep 13, 2013 at 9:38pm UTC
Sep 13, 2013 at 9:43pm UTC
@OP
Line 13. You are accessing the array at an index beyond its boundaries. Then, (this is where the compiler error comes in) you attempt to assign an entire initializer list to an int.
Edit:
If you use new, remember to use delete.
Last edited on Sep 13, 2013 at 9:43pm UTC
Sep 13, 2013 at 10:14pm UTC
I am suppose to use a dynamic array though