dimanche 2 décembre 2018

Vector initialised without size produces run time error whereas when initialised with size error goes away

the following code compiles without any errors but produce run time error (abc.exe has stopped working) , after i enter an element of the vector. Process terminated with status -1073741510 (0 minute(s), 52 second(s)) is shown in IDE.

image link

but once i give size to vector,as shown below , the error goes away.

image link

why does this happen?

Aucun commentaire:

Enregistrer un commentaire