Array indices start from 0 and go up to size-1, not from 1 to size
Because you have for (int i=1 ....
if you make it for (int i=0 ...
it'll compile and output what you want...
EDIT:
I guess thats the same as Bazzy said, but then in my noob language :P
EDIT:
and by the way, why not use iostream? the .h version is outdated (and the C version right?)
Last edited on
iostream.h is pre-standard C++
<iostream.h> is pre-1998
<iostream>+std is standard C++
very quick reply!
just use #include <iostream.h>
to save time.
Modern compilers will reject that. You should follow the standards