- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
6 Posted Topics
I will try my best to keep this as simple as possible, hope I can be of help: > The problem I seem to be encountering is when I use new to declare an array. Allocating memory via `new` can throw a `std::bad_alloc` when there isn't enough memory to use. …
If you don't have a unit testing framework at hand, you could use some simple asserts for now, I guess. It might depend on what IDE you use too, because, for example, I have been using Visual Studio's unit testing 'framework' for some time now and it's pretty elegant. As …
You're probably 8 years late, @pankaj_13. Even tho it's an old question, I'm going to suggest one way of displaying `\n` on the console, using C++11: Using raw strings (string literal officialy): #include <iostream> int main() { std::cout << R"(\n)"; return 0; } You simply type your string, enclose it …
Many warnings and mistakes in your code (not saying this to put you down or anything) so I will try to take it step by step. Firstly, you should *define* your classes in your header (.h) files. That is, move your two derived classes ('Staircase' and 'Localization') definitions into the …
Firstly, why do you allocate a dynamic array with size 0? unsigned size = 0; string * ptr = new string[size]; Secondly, if you're going to use std::string as you are now, then you must also include `<string>`. Thirdly, your questions are hard to understand so the following code might …
The End.