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";
More Related Contents:
- When to use bit-fields in C?
- Why don’t the C or C++ standards explicitly define char as signed or unsigned?
- What Rules does compiler have to follow when dealing with volatile memory locations?
- Why is sizeof giving incorrect number of bytes in C++?
- c++ Making a code that displays equations and keep getting the “expression must have integral or unscoped enum type” error
- Size of character (‘a’) in C/C++
- Where in memory are my variables stored in C?
- Which is faster: Stack allocation or Heap allocation
- Why aren’t pointers initialized with NULL by default?
- Why is address zero used for the null pointer?
- how does array[100] = {0} set the entire array to 0?
- How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
- Difference between string and char[] types in C++
- “X does not name a type” error in C++
- What exactly is a type cast in C/C++?
- C++ auto keyword. Why is it magic?
- Do class/struct members always get created in memory in the order they were declared?
- Inadvertent use of = instead of ==
- g++ variable size array no warning?
- What is “bit padding” or “padding bits” exactly?
- Why is the phrase: “undefined behavior means the compiler can do anything it wants” true?
- Is Python faster and lighter than C++? [closed]
- C++ Class wrapper around fundamental types
- How is its lifetime of a return value extended to the scope of the calling function when it is bound to a const reference in the calling function?
- Can you allocate a very large single chunk of memory ( > 4GB ) in c or c++?
- Switch passed type from template
- Can undefined behavior erase the hard drive?
- How to determine if returned pointer is on the stack or heap
- Template type deduction in C++ for Class vs Function?
- Does an R compiler to C/C++ exist?