Skip to main content
3 votes
2 answers
111 views

I would like to hide this line, looked in every indent and structure option but cannot manage to find which one makes this appear. I do not have extensions installed (monokai theme). I have disabled ...
evilmandarine's user avatar
13 votes
5 answers
3k views

Can one write static char str[] = "Foobar\0"; And be sure that the compiler generates two terminating 0's? One explicitly, the \0. The other one implicitly, the default string terminating 0....
Deve Loper's user avatar
0 votes
1 answer
103 views

In the following Rust code, I have an array of strings and I try to iterate over the names so that I can add them to my egui UI. I get two errors: error: expected a literal and error: argument must be ...
mj_'s user avatar
  • 6,469
4 votes
2 answers
164 views

Related to Is it bad to declare a C-style string without const? If so, why? , but that question is about best practise, while mine is more language lawyer. Similar questions have been asked, but for C+...
Dominik Kaszewski's user avatar
5 votes
1 answer
195 views

I want to check, that a string literal doesn't have some specific value. #include <assert.h> static_assert("aaa"[0] != 'a'); However, this results in this error: error: expression in ...
Caulder's user avatar
  • 459
3 votes
2 answers
599 views

I want to switch from synchronous db calls to asynchronous db calls. I don't want to change my query builder. My query builder outputs a sql query as a string (actually in reality it outputs a query ...
Fogux's user avatar
  • 159
0 votes
1 answer
65 views

I discovered today, to my horror, that Postgres accepts newline characters inside single- and double-quoted string literals: postgres=# select 'a postgres'# b'; ┌──────────┐ │ ?column? │ ├──────────┤ │...
Andy's user avatar
  • 8,891
19 votes
1 answer
2k views

I need braces in a raw string literal that uses interpolation: var bar = "Bar"; var s = $""" Foo {bar} Baz {{Qux}} """; Console.WriteLine(s); I expect ...
lonix's user avatar
  • 22.4k
1 vote
1 answer
69 views

I am trying to build a generic type, that will guarantee presence of the string literal (no matter at what position) What I desire for: // 'a' is in the first position const x1: ArrayContainingLiteral&...
Juraj Zovinec's user avatar
0 votes
1 answer
104 views

I am new to Mojo and just started learning the language. I am practicing some code on my Jupyter notebook in my Mac mini. My Mojo version is 24.4.0 CASE1: The below simple code for ListLiterals gives ...
dig_123's user avatar
  • 2,398
1 vote
1 answer
148 views

I have a number of user-defined classes for which I would like to define a to_string function. However, instead of defining this for just std::string, I would like to define this for all the possible ...
Involute's user avatar
  • 245
1 vote
0 answers
138 views

I got this code to recurse into Categories structure: I used this query: err = DB.Exec(` WITH RECURSIVE CategoryCTE AS ( SELECT ID, Title, Parent_id, Description, ...
sjiamnocna's user avatar
2 votes
2 answers
197 views

I spent some time while diagnosting the bug where I lost the comma between two strings created with std::string_literals. EDIT As soon a lot of commenters address to really clear case of compiler like ...
Dewfy's user avatar
  • 23.8k
7 votes
3 answers
275 views

When using multi-line raw string literals, how do we tell the compiler not to include the leading spaces? I have the following bit of code: #include <string> #include <print> int main() { ...
Penny Dreudter's user avatar
1 vote
1 answer
128 views

I have a task where I want a function in TypeScript to accept a string key of an object and infer the type of the value that the key points to. I'm almost there, but I'm running into an issue where ...
user9582211's user avatar

15 30 50 per page
1
2 3 4 5
85