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
2 answers

I want to write a program to calculate the result of a student by using the structure and print the position

In this program i want to take students information using structure and print the position. And in the quiz section only the best one will count out of three. Now when i run the program it doesn't take any inputs. It just asks for the number of the…
sun
  • 33
  • 2
1
vote
0 answers

Specifying the identity variance-covariance matrix for nlme::lme in R?

I am assembling an R code file that exhibits various common variance-covariance (VCV) structures for use in nlme::lme. I currently have what I believe to be correct code examples for scaled identity, diagonal, compound symmetry, heterogeneous…
wobbrock
  • 11
  • 3
1
vote
1 answer

How to define and initialize C structure containing structure arrays

I have main structure which is containing 2 arrays of another structures. I am using it in code as constant so I would like to initialize it in advance. How would I do it correctly? This is my example, it throws milion warnings and obviously doesn't…
andz
  • 274
  • 1
  • 3
  • 12
1
vote
0 answers

Is there a way to implement non-member [] operator in C++?

I wrote a struct to maintain a state of tic-tac-toe game. struct Board{ std::vector> board; Board() { board = std::vector> (3, std::vector (3)); } std::vector & operator[](int id)…
Fly_37
  • 312
  • 1
  • 12
1
vote
1 answer

Using fread/fwrite to read and write structures to and from a file in C

I have the following structs: typedef struct { char last[NAMESIZE]; char first[NAMESIZE]; } name; typedef struct { int id; name name; float score; } record; typedef struct { record *data; size_t nalloc; size_t nused; }…
LoveThatPink
  • 19
  • 1
  • 3
1
vote
1 answer

DBT - best practices to create staging views for the final business model

I am working on a business model/view, whose raw SQL definition contains a very complex query on the source table. My question here is - that I need to create multiple staging models on the source table as there are different specific select queries…
user961
  • 453
  • 6
  • 20
1
vote
2 answers

Which condition I'm failing to satisfy in removing circular doubly linked list?

This is my removing function. void removeAt (int pos) { struct Node *temp= (struct Node *) malloc(sizeof(struct Node *)); struct Node *x=(struct Node *)malloc(sizeof(struct Node *)); if(pos==1) { if(head==tail) { temp=head; …
1
vote
2 answers

Can I convert a structure pointer to point to an initial anonymous member in C1x? Is this even the right question?

I'm a bit confused about anonymous structures in C1x. Does the rule that a struct pointer, suitably converted, points to it's first member apply to an initial anonymous struct, or simply to the initial member of an initial anonymous struct? In…
Michael Morris
  • 319
  • 3
  • 13
1
vote
1 answer

Resize ctypes array within structure

I have these C structures and function prototypes within my libray.dll. I´m interested in pvData field, which will contain an array of data i need to extract by calling the OnLineGetData function: typedef struct tagSAFEARRAY { void * pvData; …
1
vote
1 answer

Python How to import modules from same level packages with __init__.py?

I am having problems to organize the project structure and successfully run the program. I dont want to use the sys.path module, so I choose to create init.py files. But i notice redundancy and I am confused how to properly do this. Other packages…
Mc Midas
  • 189
  • 1
  • 5
  • 17
1
vote
2 answers

How to automatically create directory structure in Linux?

I have a problem, I have a catalog /home/robert in which there are subdirectories: Dog, Cat, Bird, Horse I want to create a Test and Test1 (automatically) in each of these directories to…
1
vote
1 answer

What is the best way to use dist and public folders in a webpack app

I am trying to do a webpack project but every tutorial I see on the internet uses the same folder for assets and distribuition, but I would like to know if there's a better way to manage assets and static files in a folder and than build everything…
Omar
  • 21
  • 2
1
vote
2 answers

Inserting in Linked List goes wrong

I can't figure out what's wrong with my code. I have experience with Linked lists but today I don't know what's wrong. When I want to print the Linked list using the printNodes() function, it doesn't print the first two nodes. I'm inserting it in a…
user15959888
1
vote
3 answers

Reading data from file into structure in c programming language

I want to read data from txt file and save those data in variables not just print output. How do I save those data from text file in variables? I tried like this and it did not work out: int value1 ; object2->value =&value1 ; *(object2->value) =…
user16836597
1
vote
0 answers

WordPress Theme File Structure

As far as I know any single[-post-type].php, page[-page-slug].php and archive[-post-type].php files should live in the root directory of the theme folder. Is there any way to put them in subfolders by category like so?
1 2 3
99
100