Questions tagged [structure]

Structure is a fundamental, tangible or intangible notion referring to the recognition, observation, nature, and permanence of patterns and relationships of entities. DO NOT USE this tag for C or C++ struct questions!

A structure can be a:

  • A structure in mathematical logic: in universal algebra and in model theory, a structure consists of a set along with a collection of finitary operations and relations which are defined on it.

  • The structure of a program

For the following topics, use different tags as indicated below:

  • A : a particular way of storing and organizing data in a computer so that it can be used efficiently.
  • A (short for "structure") is a keyword in the C and C++ languages, used to indicate a structures record.
6561 questions
1
vote
1 answer

Running all tests for a multi-binary project

Consider a multi binary project with the following structure. . ├── bin1 │   ├── config │   │   ├── config.go │   │   └── config_test.go │   └── utils │   ├── utils.go │   └── utils_test.go ├── bin2 │   ├── config │   │   ├── config.go │  …
1
vote
2 answers

Change one parameter value in structure does not affect related parameters

I have a mutable structure in Julia @with_kw mutable struct Param x::Float64 = 0.1 y::Float64 = 1/x end Now I want to change x to 0.2, so I set para = Param() and para.x = 0.2. However, para.y does not change. But what I want is to change y…
jgr
  • 125
  • 4
1
vote
1 answer

How i can create a function for reading structure from a test.txt

How i can create a function for reading structure from a test.txt. I have a good works code in main, but i need to carry out it from main(). How combine (struct student PI1[N] and (fread() or fgets() or fwrite())); struct student { char…
KonstantaV
  • 23
  • 4
1
vote
4 answers

Building a tree structure

I'm trying to build a structure like this : Parent 1 Child 1 Super child 1 Child 2 Super Child 2 Super super Child 2 I don't know how many branches there will be. I need to build my structure with an array of paths like this…
Dydaser
  • 19
  • 3
1
vote
1 answer

How to read from the file and write it in the structure? I have a little trouble with my code

I have to write this code, I mean I should read from the file name of students and their mark, and then sort students by the grow of mark. Now I just want to output only mark. I want to display grades using structures. I don't know where the problem…
KonstantaV
  • 23
  • 4
1
vote
1 answer

mergesort for array of pointers to structs

I'm trying to write a generic mergesort for arrays holding pointers to different structs. I'm at a point that the compiler doesn't give any errors, but the sort function doesn't give the right output yet. The two structures and the two compare…
Neutrino
  • 46
  • 7
1
vote
4 answers

Accessing a pointer through a nested structure

struct x { int *u; }; struct y { struct x *z; }; int main() { static y b; static int g=7; b.z->u=&g; } The statement b.z->u=&g gives a segmentation error. If I remove the static in front of int g: int g=7; b.z->u=&g; The code…
karan
  • 313
  • 2
  • 3
  • 20
1
vote
3 answers

Assigning values to a struct member without using the members name in c?

I have a structure and what I would like to do is to assign values to its members using a for loop. That way I do not have to use the members name. Because the structure is long and i do not want 20 lines of p_struct->member_name etc. What I have so…
infinitloop
  • 2,863
  • 7
  • 38
  • 55
1
vote
2 answers

Swift Struct in Array of Structs not updating to new values

This is my data structure struct SPPWorkout: Codable { static let setKey = "Sets" static let exerciseID = "id" var id: Double? = 0.0 var duration: String? var calories: Int? var date: String? var exercises:…
trusk
  • 1,634
  • 2
  • 18
  • 32
1
vote
1 answer

How do I change the value of a character array inside a structure array which is being passed into a function as a pointer to the struct array? (in C)

I am trying to parse the contents of a file into an array of a stucture. I only include the parts of the code that are of interest. The issue in the code lies in my attempting to access (*data[i]).title. My code gets stuck on this line but I dont…
1
vote
1 answer

Whys is here i am unable to print the info?

the console is showing the following when I am trying to run it. can someone tell me how to fix it: arrow.c:3:23: warning: 'struct student' declared inside parameter list will not be visible outside of this definition or declaration void…
1
vote
1 answer

Console.log for solidity Array of Structure

I would like to use the console.log for displaying an array of structure. I succeed only in displaying an attribute of the structure, not the all structure. I got this error: Member "log" not found or not visible after argument-dependent lookup in…
DamTan
  • 189
  • 1
  • 3
  • 14
1
vote
1 answer

Stack - Push implementation

Can anyone please explain here what is the issue in the below code because of that it is not producing any errors as well as any output? #include #include typedef struct Stack{ int size; int top; int…
1
vote
3 answers

String in structure gets deleted

I'm working on the last exercise of the "Think like a computer scientist, C version" book and I have some trouble with one particular point. The exercise consists of making a small game, where the computer picks a random value between 0 and 20 and…
1
vote
0 answers

Including existing files to Visual studio 2022, keeping folder structure

How can I include external files into a visual studio project and keeping the folder structure? I have a folder holding a huge sum of files, nicely ordered into folders and sub folders but when I copy this into my project, only the files are being…
JesseB1234
  • 147
  • 7