Top "Struct" questions

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

How to print struct variables in console?

How can I print (in the console) the Id, Title, Name, etc. of this struct in Golang? type Project struct { …

struct go
Struct like objects in Java

Is it completely against the Java way to create struct like objects? class SomeData1 { public int x; public int y; } …

java oop struct
What are the differences between struct and class in C++?

This question was already asked in the context of C#/.Net. Now I'd like to learn the differences between a …

c++ oop class struct c++-faq
Structure padding and packing

Consider: struct mystruct_A { char a; int b; char c; } x; struct mystruct_B { int b; char a; } y; The …

c struct structure padding packing
When should I use a struct rather than a class in C#?

When should you use struct and not class in C#? My conceptual model is that structs are used in times …

c# struct
Vector of structs initialization

I want know how I can add values to my vector of structs using the push_back method struct subject { …

c++ vector struct push-back
What does "request for member '*******' in something not a structure or union" mean?

Is there an easy explanation for what this error means? request for member '*******' in something not a structure …

c struct unions
dereferencing pointer to incomplete type

I've seen a lot of questions on this but I'm going to ask the question differently without specific code. Is …

c struct compiler-errors typedef dereference
C programming: Dereferencing pointer to incomplete type error

I have a struct defined as: struct { char name[32]; int size; int start; int popularity; } stasher_file; and an array …

c struct dereference
How to convert string to IP address and vice versa

how can I convert a string ipAddress (struct in_addr) and vice versa? and how do I turn in unsigned …

c++ string struct ip-address in-addr