Category "struct"

Itering and compare struct element with different size

I've a tricky question and I don't know if there is any solution. Basically I've populated a struct using x-macros, for example with the following macro: #defin

Itering and compare struct element with different size

I've a tricky question and I don't know if there is any solution. Basically I've populated a struct using x-macros, for example with the following macro: #defin

How to share same implementation and maybe share fields

How can I simplify this code? I still can't wrap my head around rust's traits and structs after OOP. struct Player { entity: Entity, hp: i32, atk: i

unmarshal xml to []structs with xml.Name

Problem I need to unmarshal XML from an 3rd party application to my GO struct. what i tried I created structs and am able to generate identical XML from my code

Remove an element from array of structs with pointers

I have to implement the appointmentData_remove function which removes an element of type tAppointment from the tAppointmentData array. Data types are defined li

How to read a C struct (or Numpy record array) into a Polars Dataframe?

I have a binary file containing records from a C struct. I would like to read that file into a Polars Dataframe. I can accomplish that as below, but I'm wonderi

C code collecting info through a function and passing it back, of datatype struct

//Program is to collect input from user so that can pass the array of inputs from the user to another print function but that are quite some Errors in the code

golang: BaseRepository usage with different struct return type [duplicate]

I have the following code with two repositories that have the same functionality but different return types. I want to call the findAll method

i can't seem to understand a C code to sort a linked list of data

i have been given a code to sort a linked list that contains links (we call them maillons in french, sorry i don't really know how it's called in english) of Op

How do I know which endian to use in struct.unpack() when converting hexadecimal string to float?

I have data in form of hexadecimal string and I convert it to float as: import struct, binascii a = '0X437A1AF6' x = struct.unpack('>f', binascii.unhexlify(s

In C, I'm having trouble getting an Index sorted High to Low and vice versa

I'm working on a project involving a preset array: primaryArray[8] = {8, 4, 2, 16, 32, 124, 64, 256}; Im calling a function before the main, its not quite worki

problem in using fprintf_s(getting warnings) in c

I'm new in c.I just want to complete my project.a list of student with struct.and one of the option is save data in a file. I using visual studio 2022 and BTW I

What is the rationale for "structure with flexible array member shall not be a member of a structure"?

C11, 6.7.2.1 Structure and union specifiers, Constraints, 3 (emphasis added): A structure or union shall not contain a member with incomplete or function type

Passing an array in struct initialization

I would like to create a struct which contains both an int and an array of int. So I define it like struct my_struct { int N ; int arr[30] ; int arr[30][30] ; }

How to find neighbors average in matrix and assign it to a real number struct?

I have this assignment for college where i recieve the matrix A and i need to create the matrix B, where in each cell there whould be the neighbor's average of

Cannot restart typedef'd 2D array whose address is saved in struct

I have this typedef and struct: typedef double mat[MAT_SIZE][MAT_SIZE]; typedef struct matList { char *name; mat *matrix; } matList; and I create an a

using a string to reference a struct

I'm having troubles with a function in C using a string to reference a struct, the used code is included below int Search_name (char nombre[],Nentrada user_numb

Does `offsetof(struct Derived, super.x) == offsetof(struct Base, x)` hold true in C?

I am unsure what André Caron means here: Virtual functions in C ... some of this code relies on (officially) non-standard behavior that "just happens" t

building a nested JSON

Some data files that I need to read / parse have headers in the style: level0var = value0 level0var.level1field = value1 level0var.level1array[11].level2field

ConfigureAwait(false) and struct implementation of IAsyncDisposable

I have implemented IAsyncDisposable with an ActionOnAsyncDispose struct as shown below. My understanding is that the compiler will not box it when it is in an a