Category : size

In the code below I have simply filled a vector ‘a’ with n elements. After that I have calculated its size manually by size = sizeof(a)/sizeof(a[0]). Suppose n = 5 and a = {1, 2, 3, 4, 5}. Then size should be equal to 5(same as n) but it’s 6. Why is that? #include <iostream> ..

Read more