C++ string literal data type storage

c++, compiler-construction, memory, storage, types

Solution

it is packaged with your binary -- by packaged I mean hard-wired, so yes you can return it and use it elsewhere -- you won't be able to alter it though, and I strongly suggest you declare it as:

const char * x = "hello world";

Problem

``` void f() { char *c = "Hello World!" } ``` Where is the string stored? What's the property of it? I just know it is a constant, what else? Can I return it from inside of the function body?

Original source