Category "struct"

Pad a struct so its size is a multiple of 16 bytes

I'm trying to have my C# struct match up some complex padding and packing rules. Fields should be aligned on 4 byte boundaries. The entire struct should be a mu

How to store dynamically generated JSON object in Big Query Table?

I have a use case to store dynamic JSON objects in a column in Big Query. The schema of the object is dynamically generated by the source and not known beforeha

How to create 24 bit unsigned integer in C

I am working on an embedded application where RAM is extremely tight. For this purpose I need to create a 24 bit unsigned integer data type. I am doing this us

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

C++ union struct with struct member works on Clang and MSVC but not GCC

I am trying to define a union struct with some struct and primitive members overlapping in memory with a simple array. This works perfectly in Clang and MSVC, b

Code generation for struct property of user control

I create a user control like below: public partial class TestControl : UserControl { [DesignerSerializationVisibility(DesignerSerializationVisibility.Conte

Are nested structs supported in Rust?

When I try to declare a struct inside of another struct: struct Test { struct Foo {} } The compiler complains: error: expected identifier, found keywor

How to search for an element in a golang slice

I have a slice of structs. type Config struct { Key string Value string } // I form a slice of the above struct var myconfig []Config // unmarshal a

Print Struct name in swift

It is possible to know the name of a struct in swift ? I know this is possible for class: Example class Example { var variable1 = "one" var variable2 =

Avoiding allocations but without allowing default zero values for value types

Value types in C# can't have a parameterless ctor, as the default behaviour for CLR when creating an instance without parameters is to just zero all the bits. A

Golang : Is conversion between different struct types possible?

Let's say I have two similar types set this way : type type1 []struct { Field1 string Field2 int } type type2 []struct { Field1 string Field2 i

Is there an equivalent C# syntax for C's inline anonymous struct definition?

Greetings Overflowers, I know in C we can define a struct inline with the variable declaration so that the struct type is specific to this variable. This is in