Category "literals"

A question about returning local pointer variable in function

I know the variables in function are using stack space. When function exit, the space are freed. That's why we should declare the pointer variable as static in

How do I construct an object of a slice struct?

package main import ( "fmt" ) type demo []struct { Text string Type string } func main() { d := demo{ Text: "Hello", Type:

How do I do a literal *int64 in Go?

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, w

Macro to repeat a single character multiple number of times

I am learning about macros and I want to know that whether it is possible to create a macro that repeats a given character literal a given number of times. For

Is there a functional difference between "2.00" and "2.00f"?

I ask because I am using the Box2D library, which calls for mostly float arguments. Although I see a lot of example code that uses the 0.00f format, I am not qu