How to add element to C++ array?

There is no way to do what you say in C++ with plain arrays. The C++ solution for that is by using the STL library that gives you the std::vector. You can use a vector in this way:

Deleting a dynamically allocated 2D array

In reality, an array of pointers pointed to by a pointer is still an array of integral data types or numbers to hold the memory addresses. You should use delete[] for both. Also, yes, a new[] implies a delete[]. When you create an array of arrays, you’re actually creating an array of numbers that happen to hold the memory address for another array … Read more

Reading getline from cin into a stringstream (C++)

You are almost there, the error is most probably1 caused because you are trying to call getline with second parameter stringstream, just make a slight modification and store the data within the std::cin in a string first and then used it to initialize a stringstream, from which you can extract the input: 1. Assuming you have included:

Remove an array element and shift the remaining ones

You just need to overwrite what you’re deleting with the next value in the array, propagate that change, and then keep in mind where the new end is: Now your array is {1, 2, 4, 5, 6, 7, 8, 9, 9}. You cannot delete the extra 9 since this is a statically-sized array, you just have to ignore … Read more

Uninitialised value was created by a stack allocation

The meaning of the error is essentially that you’re using a variable before you assign to it. The only variables this can possibly apply to are dd, mm, yy. This means that your sscanf call is not writing to all three of them. This will occur if you pass in a date that isn’t completely specified. Note that sscanf returns a value … Read more