can you elaborate some more on this maybe with some code?
Type: Posts; User: rnx40401
can you elaborate some more on this maybe with some code?
Can we chain an overloaded << operator
cout <<a<<b
without declaring the overloaded operator<< function friend?
I know that if there is no access to private members then we can avoid the...
what will the compiler generate in this case?
class D{
}
I agree that getting abc back would be harder in a big system but in which case do we get a runtime error? when the memory is freed or when the memory is overwritten. My guess is that when the memory...
As I asked earlier is there a remote chance of getting abc back in a large system? I guess it would behave differently on a laptop from a 1500 system environment
The question here is that is getting a runtime error a garuntee? I agree that it is wrong to refer to a local variable when it gets out of scope but in a large system is there a one in a million...
Why not just test and see? Of course, even if you do not get a runtime error, returning a reference to a local variable is still wrong.
Are you sure that even for a arge system we get an error?
is there a runtime error here when you call the get method?
#include <string>
using namespace std;
class A {
public:
string& get() {
Hi, my question is what is wrong with this code?
class T;
int main(){
T *p = 0;
delete p;