array of char

ok this is something weird. a character variable can only store 1 character but an array of char having only 1 element can store huge values like "weeeerfffffffssssssssssssssssssssssssssaaaaaaaaaaaaaaaaadhvgj"
HOW IS THIS POSSIBLE?????
It's not.
char array[1]="stringLongerThatOneCharacter";
will throw an error.
i didn't use assignment operator. i inputted a value using cin. try it
Inputing from cin seems to exceed the array limit and gets into unassigned memory space. Try that in a structure and you'll see that everything messes up.
true
true
Topic archived. No new replies allowed.