Top "C-strings" questions

A string in the programming language C is represented as a sequence of characters followed by a null terminator (represented as \0).

When/Why is '\0' necessary to mark end of an (char) array?

So I just read an example of how to create an array of characters which represent a string. The null-character \0 …

arrays c char c-strings null-terminated
Set Qt default encoding to UTF-8

In my Qt application my source code files are encoded as UTF-8. For the following code... QMessageBox::critical(this, "Nepoznata …

qt utf-8 character-encoding c-strings
Determine #defined string length at compile time

I have a C-program (an Apache module, i.e. the program runs often), which is going to write() a 0-terminated …

c macros c-preprocessor c-strings strlen
Can a std::string contain embedded nulls?

For regular C strings, a null character '\0' signifies the end of data. What about std::string, can I …

c++ stdstring c-strings null-terminated
Proper way to copy C strings

Is there an easy way to copy C strings? I have const char *stringA, and I want char *stringB to …

c++ string copy c-strings
C-String array initialization - is this mutable?

Possible Duplicate: Modifying C string constants? Pointer to const char vs char array vs std::string I know I'm probably …

c++ c-strings
C string to uppercase in C and C++

While I was putting together a to-uppercase function in C++ I noticed that I did not receive the expected output …

c++ c string uppercase c-strings
How to declare constexpr C string?

I think i quite understand how to use the keyword constexpr for simple variable types, but i'm confused when it …

c++ constexpr c-strings string-literals
Is sprintf(buffer, "%s […]", buffer, […]) safe?

I saw use of this pattern to concatenate onto a string in some code I was working on: sprintf(buffer, "%…

c printf c-strings