Top "Struct" questions

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

What needs to be overridden in a struct to ensure equality operates properly?

As the title says: do I need to override the == operator? how about the .Equals() method? Anything I'm missing?

c# .net struct operators equals-operator
How to properly use cin.peek()

This function is supposed to read a fraction and place it in an array. If the user enters '0' …

c++ struct cin peek
How to use SCNetworkReachability in Swift

I'm trying to convert this code snippet to Swift. I'm struggling on getting off the ground due to some difficulties. …

ios c struct swift reachability
C++ Private Structures

I have read that the main differences between classes and structures (other than functions), is that class members default to …

c++ struct structure private-members
Changing The value of struct in an array

I want to store structs inside an array, access and change the values of the struct in a for loop. …

arrays swift struct
How to iterate over of an array of structures

In my application I use an array of structs and I need to iterate over the array. What is the …

c arrays struct iteration boundary
undefined C struct forward declaration

I have a header file port.h, port.c, and my main.c I get the following error: 'ports' uses …

c struct declaration forward
Sizeof struct in Go

I'm having a look at Go, which looks quite promising. I am trying to figure out how to get the …

struct go sizeof
What does the keyword "new" do to a struct in C#?

In C#, Structs are managed in terms of values, and objects are in reference. From my understanding, when creating an …

c# object struct
What is a hash table and how do you make it in C?

I have a few questions on a data-structure called a hash table (also know as associative array) and how it …

c data-structures struct hashtable