Indeed, make it a template functions, or maybe even just use the STL with it's container types. I'm sure there will be some sort of stack already available for you, although I am not sure which...
Type: Posts; User: Hoegje
Indeed, make it a template functions, or maybe even just use the STL with it's container types. I'm sure there will be some sort of stack already available for you, although I am not sure which...
Yes it is, and when your object goes out of scope, the (default) destructor for that object is called, so that will take care of all the memory cleanup for you. That is only if you haven't put...
#include <iostream>
int main(){
std::cout << "Hello code !";
return 0;
};
>> if (answer = 2);
this should be "if (answer == 2)" without the quotes.
Because you put a semicolon after this statement the compiler doesn't expect an else statement.