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).

How do strings and char arrays work in C?

No guides I've seen seem to explain this very well. I mean, you can allocate memory for a char*, or …

c arrays string c-strings
Is there anyway to create null terminated string in Go?

Is there anyway to create null terminated string in Go? What I'm currently trying is a:="golang\0" but it is …

string go c-strings
How to write a better strlen function?

I am reading "Write Great Code Volume 2" and it shows the following strlen impelementation: int myStrlen( char *s ) { char *start; …

c string optimization pointers c-strings
static_cast from 'const char *' to 'void *' is not allowed

In C++, I'm trying to print the address of a C-string but there seems to be some problem with my …

c++ casting c-strings
How to determine if strings are equal in Objective C?

I read a string from a JSON result as follows: NSString *strResult = [[NSString alloc] initWithBytes:[data bytes] length:[data length] …

objective-c c-strings
Convert char** (c) of unknown length to vector<string> (c++)

How would one go about converting a C char** to a C++ vector? Is there some built-in functionality one can …

c++ arrays string vector c-strings
What if I don't call ReleaseBuffer after GetBuffer?

From CString to char*, ReleaseBuffer() must be used after GetBuffer(). But why? What will happen if I don't use ReleaseBuffer() …

c++ mfc c-strings getbuffer
What happens to memory after '\0' in a C string?

Surprisingly simple/stupid/basic question, but I have no idea: Suppose I want to return the user of my function …

c string pointers malloc c-strings
constexpr function returning string literal

A function returning a copy of an integer literal int number() { return 1; } can be easily converted to a plain compile-time …

c++ string c++11 constexpr c-strings
Convert String^ in c# to CString in c++/CLI

I need a help on one question where I stuck while coding my app in MFC. I am using CLR …

c# .net string mfc c-strings