literals Questions

4

How do you write a Binary Literal in Dart? I can write a Hex Literal like so: Int Number = 0xc If I try the conventional way to write a Binary Literal: Int Number = 0b1100 I get an error. I've tr...
Quinine asked 29/7, 2020 at 19:4

2

Solved

I have a string in UTF-8 format but not so sure how to convert this string to it's corresponding character literal. For example I have the string: My string is: 'Entre\xc3\xa9' Example one: This...
Samul asked 4/7, 2014 at 10:5

4

Solved

In C one can have string literals in the form of char *string = "string here"; integer literals: uint8_t num = 5; long literals: long long bigNum = 90322L; floating point literals: float...
Kafka asked 13/6, 2014 at 19:42

5

Solved

Problem Is there a way in Typescript to define a type that is only a string literal, excluding string itself? Note that I am not talking about a certain list of string literal; for which, a simpl...
Glaswegian asked 12/2, 2020 at 9:30

6

Solved

In order to work with decimal data types, I have to do this with variable initialization: decimal aValue = 50.0M; What does the M part stand for?
Illegal asked 10/6, 2009 at 18:50

5

I want to narrow a string to a string literal union. In other words, I want to check if the string is one of the possible values of my literal union, so that this will work (if the operator couldbe...
Buckbuckaroo asked 16/5, 2017 at 14:43

5

Solved

I have a struct type with a *int64 field. type SomeType struct { SomeField *int64 } At some point in my code, I want to declare a literal of this (say, when I know said value should be 0, or po...
Busload asked 8/6, 2015 at 18:21

3

Solved

I'm confused about the type of a string literal. Is it a const char * or a const char?
Tympanist asked 20/9, 2012 at 17:45

3

I'm trying to use a "literal" multi-column table for a join query with Oracle 11g. Here's the best I've come up with, based on this answer ( this answer suggests a much nicer syntax, but it only w...
Milly asked 27/4, 2015 at 18:32

7

Solved

In a verbatim string literal (@"foo") in C#, backslashes aren't treated as escapes, so doing \" to get a double quote doesn't work. Is there any way to get a double quote in a verbatim string liter...
Bruch asked 18/12, 2009 at 15:36

6

Solved

I have the function below which accepts a bool pointer. I'm wondering if there is any notation which allows me to set the value of the is field to true in the struct literal; basically without to d...
Measly asked 2/3, 2015 at 19:31

11

Solved

"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false false instanceof Boolean ...
Vaccaro asked 15/10, 2008 at 4:44

2

Solved

Does C++23 now provide support for Unicode characters in its basic char type, and to what degree? So on cppreference for character literals, a character literal: 'c-char' is defined as either: ...
Crescendo asked 6/9, 2023 at 20:46

9

Solved

When you create an integer with leading zeros, how does C handle it? Is it different for different versions of C? In my case, they just seem to be dropped (but maybe that is what printf does?): #in...
Stoltzfus asked 2/11, 2009 at 13:31

24

I am working through the book "Introduction to Computation and Programming Using Python" by Dr. Guttag. I am working on the finger exercises for Chapter 3. I am stuck. It is section 3.2, page 25. T...
Midyear asked 19/1, 2014 at 3:3

3

Solved

I want to use the format! macro with a String as first argument, but because the macro expects a string literal, I am not able pass anything different to it. I want to do this to dynamically add st...
Stiffen asked 14/9, 2015 at 19:31

9

Solved

Typically, I've seen people use the class literal like this: Class<Foo> cls = Foo.class; But what if the type is generic, e.g. List? This works fine, but has a warning since List should be...
Carve asked 5/3, 2010 at 23:33

4

Solved

When I try to assign an 128-bit integer in gcc 4.9.1, I get a warning: integer constant is too large for its type. Example Code int main(void) { __uint128_t p = 47942806932686753431; return 0; }...
Laurilaurianne asked 16/7, 2015 at 17:57

3

Solved

I'm in trouble trying to remove rows from a dataframe based on two-column list of items to filter. For example, for this dataframe: df = spark.createDataFrame([(100, 'A', 304), (200, 'B', 305), (30...
Homely asked 6/1, 2017 at 18:22

5

C++03 5.1 Primary expressions §2 says: A literal is a primary expression. Its type depends on its form (2.13). A string literal is an lvalue; all other literals are rvalues. Similarly, C99 6.5...
Doti asked 4/4, 2012 at 3:23

14

Solved

Technically, any odd number of backslashes, as described in the documentation. >>> r'\' File "<stdin>", line 1 r'\' ^ SyntaxError: EOL while scanning string literal >>> ...
Bebebebeerine asked 15/3, 2009 at 12:54

1

Solved

Is this really the best way to declare a byte (or array of bytes)? static constexpr byte kGuard1_[] = { byte{0x45}, byte{0x23}, byte{0x12}, byte{0x56}, byte{0x99}, byte{0x76}, byte{0x12}, byte{0x5...
Hardness asked 10/2, 2023 at 13:26

2

Solved

In golang what are struct literals? Why is the following a literal even though there is a variable? And aren't structs literally variable, even when not const? So how does it make sense. MyType{F...
Pithos asked 20/3, 2015 at 18:44

8

Solved

Sometimes for algebraic types it is convenient to have a constructor that takes a literal value 0 to denote the neutral element, or 1 to denote the multiplicative identity element, even if the unde...
Wordy asked 17/5, 2020 at 19:40

4

Solved

What is the meaning and difference between these queries? SELECT U'String' FROM dual; and SELECT N'String' FROM dual;
Gavrah asked 3/1, 2018 at 11:25

© 2022 - 2024 — McMap. All rights reserved.