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

Does endless creation of objects to start new game hog ram in Python?

I made my first game with python. The structure of program is roughly this: import pygame class Game: def __init__(self): pygame.init() ... rest of the code def new_game(self): Game() ...rest of the code if __name__…
Heikki
  • 341
  • 2
  • 18
1
vote
2 answers

Is there any way to get offset of structure member to assembly code?

For example, I have the following structure, struct thread { char *pName; ... // number of members between may be different for different configurations int member; ... }; For different configurations, there may be different…
Wanghz
  • 305
  • 2
  • 12
1
vote
1 answer

How do I structure OOP and OOD in a larger PowerShell script?

I'm not sure how to structure a larger PowerShell script that uses classes, and I cannot find anything. I have five classes in one file. How do I call them without a main class? Is it proper to create a standalone script that simply instantiates…
learntofix
  • 87
  • 5
1
vote
0 answers

ctypes segmentation fault when the structure saved in the file is read

I have a problem that when using in a ctypes (python) structure c_char_p, after having saved the structure in the file and finished the code. When the structure is read with readinto and the attribute signed with c_char_p is called, segmentation…
user16070621
1
vote
1 answer

Is there any way to exclude a component via the type table syntax?

I am trying to declare a global table gt_sel2 as type table zqmqnewslist(which is a structure), however one component of the zqmqnewslist which is PRUEF(type ZQMKZPRUEF), I do not want it in the newly table gt_sel2. Is there any way to declare the…
Frank
  • 153
  • 3
  • 17
1
vote
4 answers

which tiers should i catch exception when using DAL BLL and web Presentation Layer

I write a three tiers web application. DAL BLL and web Presentation Layer,every tier has methods , so the question is where should I catch exception( using try catch),in web?BLL?or DAL? and why? thank you.
SleeplessKnight
  • 2,125
  • 4
  • 20
  • 28
1
vote
0 answers

Initializing memory section with data at compile time using C++11

i'm trying to initialize a defined section in my DRAM/IRAM with some pre-defined data. For that purpose, I defined a section "my_section" in the memory map file, at some fixed address. dram0_0 : C : 0x5ffd0400 - 0x5ffdb70f : .my_section.rodata…
1
vote
1 answer

Typescript : How to group an object of named list of objects by field name

I have to manipulate data in this wonderful language which is javascript. Until there I managed to achieve what I needed on my own but I reached my limits there. It's quite hard to explain how my data is structured so let's make a schema. This is…
Artory
  • 845
  • 7
  • 13
1
vote
2 answers

Class structure or design pattern for a shared border between two cells

This is more of a "best practice" or "best approach" kind of question; I was able to solve the core Problem myself, but I wonder how a situation like this should best be resolved. Imagine a 2-dimensional board with a grid of square cells. Each cell…
Katai
  • 2,773
  • 3
  • 31
  • 45
1
vote
1 answer

Structure in ctype

I am new to ctypes. I have written a function using structure in c. I want to call it in python using ctypes. If I compile and run in linux there is no error. But if I do it using python it throws error. C-program #include struct add1{ …
shaila
  • 177
  • 2
  • 10
1
vote
1 answer

Structures padding in C

int is 4 bytes on my machine, long 8 bytes, etc. Hey, so I've encountered a pretty interesting thing in C and started wondering how structures manage their data inside. I thought it works like an array, but oh boy, I was wrong. So basically, I…
todovvox
  • 170
  • 10
1
vote
2 answers

Twincat 3 - SizeOf returning wrong structure size

I have a structure, and am trying to get the size of this structure. SizeOf returns 16, but I am expecting 14 as answer. 2+2+4+2+2+2=14 By using pointers I noticed that there are 2 empty bytes at the end of the structure. If I replace the UDINT with…
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97
1
vote
2 answers

How structure pointer and arrow operator works?

#include #include str1 { int k; struct str1 * ptr1; }; int main(void) { int * p1, * p2; struct str1 * ptr2; ptr2 = (struct str1 *) malloc(sizeof(struct str1)); ptr2 ->…
Azqaf
  • 17
  • 5
1
vote
3 answers

How structure padding is works with respect to largest size member in C?

I got some confusion while understanding structure padding concept. I have understood that structure padding increases the performance of the processor at the penalty of memory. Here i have some structure defined case 1: typedef struct{ double A;…
user2986042
  • 1,098
  • 2
  • 16
  • 37
1
vote
1 answer

I want to create 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 after giving all the inputs everything works fine except in the 74th line where i am…
sun
  • 33
  • 2