Is there a way to make a program treat a variable like a string literal?
i.e:
And not losing the data because it goes out of scope, sort of like this?Code:void func(any & x) { char * temp; // get data x = temp; }
(without dynamically allocating)Code:void func(any & x) { x = "temp"; }