Top "Struct" questions

A keyword in various programming languages whose syntax is similar to or derived from C (C++, C#, Swift, Go, Rust, etc.

Read binary file into a struct

I'm trying to read binary data using C#. I have all the information about the layout of the data in …

c# struct io binaryfiles
Cannot call value of non-function type 'String'

I'm trying to pass the ILTItem variable into my ILTViewController, triggered by AppDelegate.swift when the user launches my app …

ios swift struct viewcontroller
Is it safe to return a struct in C or C++?

What I understand is that this shouldn't be done, but I believe I've seen examples that do something like this (…

c++ c function struct return-type
When should I use Struct vs. OpenStruct?

In general, what are the advantages and disadvantages of using an OpenStruct as compared to a Struct? What type of …

ruby struct
default visibility of C++ class/struct members

In C++, why is private the default visibility for members of classes, but public for structs?

c++ class struct member
How do you initialize a map which takes a struct as value?

I am using a map as an associative array of IDs -> value, where the value is a struct …

c++ map struct initialization associative-array
Struct constructor: "fields must be fully assigned before control is returned to the caller."

Here is a struct I am trying to write: public struct AttackTraits { public AttackTraits(double probability, int damage, float distance) { …

c# constructor struct
What is 'forward declaration' and the difference between 'typedef struct X' and 'struct X'?

I am a beginner in C programming and I know the difference between struct type declaration and typedef struct declaration. …

c struct typedef
sizeof single struct member in C

I am trying to declare a struct that is dependent upon another struct. I want to use sizeof to be …

c struct sizeof
Structs versus classes

I'm about to create 100,000 objects in code. They are small ones, only with 2 or 3 properties. I'll put them in a …

c# struct