Practicing template class. This is a generic array class, but I'm not sure why the program does not terminate when I try to call "list[100] = 's'; ". Thanks in advance, making a lot of progress in C++.
Amongst other things (I haven't actually tried your code):
- you don't set length in your constructor, so it is unusable
- you don't allocate enough memory for your array; line 79 should have b-a+1, not b-a (e.g. 5-1 is 4, not 5]
- I presume you need a [] in line 71
Thanks for pointing out my mistakes, I think it is all sorted now.
Now it outputs "pAssertion failed: x >= endPoint && x <= endPoint + length, file arrayType.h, line 47" which I believe is the correct message I should be getting.
Thanks again, have been helped quite a few times by people in this forum.