void foo(const char* s) { }
foo("bar");
- Where is the memory
bardeallocated? - What is the most comfortable and memory leak free practice to work with anonymous strings in function arguments? (I know there should be no magic strings, just curious.)
In your example, the argument is a string literal, which has static lifetime, and is never deleted.