Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I'm learning c++

Name: Anonymous 2010-09-14 8:24

And my compiler is letting me do something weird.


If I do this:

int x; //matrix-size

cin >> x;

int array[x];

I can compile. I don't even get a warning. (I'm using the Codelite IDE for Linux, compiler is g++)

Does this work in c++ or is my compiler just fucking with me?

Name: Sensei 2010-09-15 20:41

>>29
Indeed that is the point of libraries. The important consideration is this: do you really need getch, or is cin good enough? Avoiding unnecessary libraries is always best. If you really do need special terminal functions, note that there are both the conio and ncurses libraries. conio is more of a Windows thing while ncurses is more of a *nix thing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List