I wander why you are using both streams and C functions for I/O.
In this program you are not creating a dynamic array. char charray[size]; is not supposed to work as 'size' is not constant.
If your program works, your compiler is not behaving in a standard way.
well i'm using mingw compiler with codeblocks. i guess maybe its not supposed to work, but it does. and I ain't complaining. How else would you create an 'dynamic' array without knowing before hand how big it would be? By dynamic I mean memory is allocated for it at runtime because it is not known what 'size' is going to be at compile time.
If I shouldn't do it in this way then how should I?
And btw, I was using the streams for debugging purposes only as I didn't want to have to take the time to write out a loop to print strings. and yeah yeah yeah i shouldn't use strings in a c program either right?