python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
What are the downsides to accessing a std::map<std::string, int> using string literals?
I have written a ResourceManager class in C++ that contains a std::map<std::string, Resource>. My current code then accesses these methods using string literals, e.g:
// ResourceManager.h
class ...
michael
Votes: 0
Answers: 1
strcpy() corrupts both strings if first argument is a char pointer
Define the following variables:
char *name1 = "Allan";
char name2[] = "Marco";
printf("%s %s\n", name1, name2); // Allan Marco
Then the following code works fine:
strcpy...
Ivan
Votes: 0
Answers: 2
mingw vs msvc on implicit conversion of string literals
I have a std::variant of different types including int32_t, int64_t, float, double, std::string and bool.
When I assign a string literal (const char*, which is not present in this variant), I assumed ...
Keshav Sahu
Votes: 0
Answers: 2
What kind of newline character is in my multiline string literal?
I'm trying to replace a new line with something, or remove it, but I can't even figure out what kind of new line character it is. I've tried \n and \r as a regular expression:
var testStr =
"&quo...

Chewie The Chorkie
Votes: 0
Answers: 1