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
15
votes
3 answers

How to initialize nested structures in C++?

I have created a couple of different structures in a program. I now have a structure with nested structures however I cannot work out how to initialize them correctly. The structures are listed below. /***POINT STRUCTURE***/ struct Point{ float…
binarycreations
  • 3,091
  • 6
  • 32
  • 38
15
votes
2 answers

Why constant constraints the property from a structure instance but not the class instance?

When I trying to change the ID property of the byValueObj instance, I received an error that told me I cannot assign to the property of a constant, even though the property is a variable. However, I can do it on a class instance. I kind of knowing…
SLN
  • 4,772
  • 2
  • 38
  • 79
15
votes
3 answers

Which SQL command can I use to see the structure of a table on SQL Server?

I have a table on a SQL Server and I would like to export its structure to send to a colleague. Which SQL command should I issue to get the structure? I don't have access to the SQL Server Management Studio.
15
votes
1 answer

Coldfusion - How to loop through an Array of Structure and print out dynamically all KEY values?

Giving the Array of Structure below: I am able to print out all values from all fields by doing:
Max
  • 1,289
  • 3
  • 26
  • 50
15
votes
3 answers

How can I ignore a field when marshalling a structure with P/Invoke

I want to marshal a structure for use with P/Invoke, but this struct contains a field that is only relevant to my managed code, so I don't want it to be marshaled since it doesn't belong in the native structure. Is it even possible ? I was looking…
Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
15
votes
1 answer

Best Structure for ASP.NET MVC Solution

I tried to structure my last sizeable MVC project following a best practice approach, but didn't quite understand what I was doing. It has a Data, Business and Web (MVC) project, but the controllers contain most of the code, the Data layer uses…
littlecharva
  • 4,224
  • 8
  • 45
  • 52
15
votes
8 answers

When structures are better than classes?

Duplicate of: When to use struct in C#? Are there practical reasons to use structures instead of some classes in Microsoft .NET 2.0/3.5 ? "What is the difference between structures and classes?" - this is probably the most popular question on…
coder
  • 185
  • 3
  • 12
15
votes
1 answer

Marshall array of structures

I've spent a lot of time to look for the solution but still don't find it out. I have 2 classes: [StructLayout(LayoutKind.Sequential)] public class Result { public int Number; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public…
Tu Tran
  • 1,957
  • 1
  • 27
  • 50
15
votes
3 answers

How do you structure your Backbone + RequireJS applications?

I've been struggling trying to strike the right balance between reusability and complexity when it comes to organizing my Backbone objects into AMD's (for medium- to large-scale applications) (A) Should every Backbone object (models, views, etc) be…
Maurice
  • 1,223
  • 14
  • 21
14
votes
2 answers

OCaml interface vs. signature?

I'm a bit confused about interfaces vs. signatures in OCaml. From what I've read, interfaces (the .mli files) are what govern what values can be used/called by the other programs. Signature files look like they're exactly the same, except that they…
14
votes
3 answers

Calloc with structure with pointers in C

I know that calloc request memory to be used, writes 0 on all the bits and then returns a pointer to it. My question is: if I use calloc with a structure that contains pointers, will those pointers have the NULL value or do I have to set them to…
Mihai Neacsu
  • 2,045
  • 5
  • 23
  • 37
14
votes
3 answers

Lock free & Thread-Safe IList for .NET

Is there a lock-free & thread-safe data structure that implements IList? Naturally by lock-free I mean an implementation that makes no use of locking primitives in .NET but rather uses interlocked operations / atomic operations to achieve thread…
damageboy
  • 2,097
  • 19
  • 34
14
votes
7 answers

Firebase realtime database structure in chat app

sorry for my bad English level, I'm from Argentina. I have the following messages data structure in Firebase: "messages" "-KezmqXSdKCNFFA432Uc___-KfCEwklG_y3naRDIUiY" "messageDate": "20170620" "messageTime": "18:44" …
Agustin
  • 143
  • 1
  • 1
  • 5
14
votes
1 answer

Is defining structure inside a function a good way to conceal the structure from other functions?

You can define a structure inside a function like this: fn user_status() -> bool { struct UserStatus { logined: bool, name: Option, } // ... true } Is this a good way to conceal structure from other functions…
vaartis
  • 334
  • 4
  • 10
14
votes
6 answers

C# array with capacity over Int.MaxValue

I was wondering if there is any structure in C# that can contain more than Int.MaxValue's restriction of 2,147,483,647 items, in case of really large sets of information. Would this have to be done with multi level arrays? Or could you create an…
Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201