This question already has an answer here:
What does 'R' mean in the context of string literals?
(1 answer)
Closed 4 years ago.
Specifically in this file
https://github.com/fireice-uk/xmr-stak/blob/master/xmrstak/backend/amd/amd_gpu/opencl/cryptonight.cl
The first line is this and the end ends with
)==="
And it seems to be sprinkled within.
Could someone explain what this is and does? I'm having a difficult time googling this.
The format for the raw-string literals[2] is: R"delimiter( raw_characters )delimiter", so === is the delimiter in R"===( and line 243 in your link
Related
This question already has answers here:
C++ Multi-line comments using backslash
(3 answers)
What does a backslash in C++ mean?
(4 answers)
Closed 2 years ago.
Why the next line after //\ is commented out in C++ ? Like I know about "//" and "/* ... */ " but after putting //\ the next line is automatically commented out !
\ at the end of a line is line continuation for comments and preprocessor.
This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 2 years ago.
I have this string
copiaElementos = "c'8 d'8 a8"
And when I do Regex.Matches(copiaElementos, "8.").Count() it returns 2
why is that? I don't understand, can anyone please give me a hand?
Thank you, best regards
That is because the . mathes one character. means you are matching an 8 followed by any charactrer, and there are exactly two of those (a space is considered a character too). Because the last one has no characters after it.
if you want to count the 8s in the string you should do Regex.Matches(copiaElementos, "8").Count(). Remember every character, even a space has its own meaning in regex.
This question already has answers here:
'colon' and 'auto' in for loop c++? need some help understanding the syntax
(3 answers)
colon in for loop in C++
(1 answer)
Closed 3 years ago.
I am asking since I couldnt immediately find an answer on google, I know the answer is simple.
what does for (char c : str) {} do in a for loop?
Thank you!
It iterates the individual characters of str, copying each one to the (local) variable c for use in each iteration of the loop.
This question already has an answer here:
Reference - What does this regex mean?
(1 answer)
Closed 4 years ago.
I am looking at someone elses code and have a question. Below is the code. Where it says: ^DR DUE does that mean the string starts with DR DUE? I am new to perl regular expressions. Also, where ATM/(DEP|WTD) does this mean match ATM/(DEP|WTD) in the string? However, I thought that ( and ) were metacharacters too. Thanks for your help!
Removed
It will match a string containing
the string "COAL"
"DR DUE TO ATM/" placed at beginning of line and followed by "DEP" or "WTD".
So it will match:
COAL
(beginning of line)DR DUE TO ATM/DEP ERROR
(beginning of line)DR DUE TO ATM/WTD ERROR
This question already has answers here:
How do I iterate over the words of a string?
(84 answers)
Closed 9 years ago.
I just wanted to know what the technical term for allocating words from a string separated by spaces to a variable is called so I can look up a tutorial for it. Any terms, links, or explanations would be greatly appreciated.
You can do it like:
QString lineText = "some sample words";
QStringList tokens= lineText.split(" ",QString::SkipEmptyParts);
You can do whatever you like with the words in the tokens list.