10
(lemmy.ml)
submitted 2 years ago* (last edited 2 years ago) by velox_vulnus@lemmy.ml to c/programming@lemmy.ml

From what I'm able to understand:

  • declaration is when prototype or declaration is used to describe the features
  • definition is when a declaration is also assigned a literal or an object, such that a chunk of memory is allocated
  • initialization is the assignment of an object, either during definition or immediately after declaration
  • assignment is the setting of a value of a particular object at any stage of the program execution

Which of the follow terms overlap? Which of them is a superset/subset of each other?

you are viewing a single comment's thread
view the rest of the comments
[-] CameronDev@programming.dev 1 points 2 years ago

Initialization is a subset of assignment. Its initialization the first time you do an assignment.

I dont think declaration and definition overlap, but they are similar concepts. I think i would have swapped your descriptions though. Normally you have a function definition, which describes the function and its features, and you have variable declarations, which is literal objects/bits of memory.

Please dont take this response as gospel, i am not super happy with it :/

this post was submitted on 10 Jan 2024
10 points (91.7% liked)

General Programming Discussion

10014 readers
29 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 7 years ago
MODERATORS