How do I find the size of a 2D array in C++? Is there any predefined function like sizeof to determine the size of the array?
Also, can anyone tell me how to detect an error in the getvalue method for arrays while trying to get a value which is not set?
strlen. Else, use vectors. They know their size, and it is retrieved viavector::size(). Even with characters, you should use a string. It has bothsize()andlength().