Top "Literals" questions

a notation for representing fixed values in source code

What does the @ prefix do on string literals in C#

I read some C# article to combine a path using Path.Combine(part1,part2). It uses the following: string part1 = @"…

c# .net string syntax literals
Why doesn't C have binary literals?

I am frequently wishing I could do something like this in c: val1 &= 0b00001111; //clear high nibble val2 |= 0b01000000; //…

c syntax binary literals
How to set bool pointer to true in struct literal?

I have the function below which accepts a bool pointer. I'm wondering if there is any notation which allows me …

pointers go struct literals
What is a class literal in Java?

From the Java tutorial: Finally, there's also a special kind of literal called a class literal, formed by taking a …

java literals
in CoffeeScript, how can I use a variable as a key in a hash?

eg: So: foo = "asdf" {foo: "bar"} eval foo # how do I get {"asdf": "bar"} ? # this will throw parse error: {(eval …

coffeescript hashmap literals
PHP object literal

In PHP, I can specify array literals quite easily: array( array("name" => "John", "hobby" => "hiking"), array("name" => "…

php object literals object-literal
How to specify const array in global scope in Rust?

When I tried to add a const array in the global scope using this code: static NUMBERS: [i32] = [1, 2, 3, 4, 5]; I got …

arrays static literals rust
Purpose of Scala's Symbol?

Possible Duplicate: What are some example use cases for symbol literals in Scala? What's the purpose of Symbol and why …

scala syntax language-design symbols literals
Backslashes in single quoted strings vs. double quoted strings

If I add a backslash+space to the start of double and single quoted strings, I get different results: "\ text" …

ruby string quotes literals backslash
Should I use _T or _TEXT on C++ string literals?

For example: // This will become either SomeMethodA or SomeMethodW, // depending on whether _UNICODE is defined. SomeMethod( _T( "My String Literal" ) ); // …

c++ winapi backwards-compatibility literals