[help] i have set the size of character array 2 byte then how can it store more than 2 byte???
i am using visual studio 2017
using namespace std;
cout << "enter the name" << endl;
cout << "the name is " << a << endl;
cout << endl;
enter the name
the name is class
C++ don't check for array bounds. You can write in memory which is beyond limit of that array but you should not do that. It can cause loss of some important data by overwriting memory.
Better use a std::string for this purpose.