0

I want to follow up on this question: What is the difference between a definition and a declaration?, there is answer about definition and a declaration, but nothing about implementation.

I want also know what is the difference between implementation and definition.

T0maas
  • 422
  • 2
  • 12
  • Related: [What does the "implementation" mean in "implementation (in)dependent"?](https://stackoverflow.com/questions/50780659/what-does-the-implementation-mean-in-implementation-independent) – Weather Vane Nov 28 '21 at 17:48
  • Those two words have nothing to do with each other, they are not related. At least not anywhere close to how declaration and definition are related. – luk2302 Nov 28 '21 at 17:50
  • An implementation is a definition. It's one way to implement an algorithm. There can be multiple. Implementation is plain English, while definition/declaration are words that have very specific meanings in C. – Marco Bonelli Nov 28 '21 at 17:50
  • definition is a place in your source code where you implement your algorithm or data. So IMO it is the same. It is not the same as implementation in the C Standard understanding, as it has completely different meaning (it related to implementation of the C features) – 0___________ Nov 28 '21 at 17:50
  • @WeatherVane that question looks different and doesnt answer what I was asked (definition vs implementation. – T0maas Nov 28 '21 at 17:50
  • @WeatherVane you probably think about implementation in C standard meaning of this word. OP is asking about different implementation. – 0___________ Nov 28 '21 at 17:51
  • Related for C# tag: [Difference between Goto Definition and Goto Implementation in Visual Studio](https://stackoverflow.com/questions/34433800/difference-between-goto-definition-and-goto-implementation-in-visual-studio) – Weather Vane Nov 28 '21 at 17:52
  • To be noted: If you stumble over *'implementation'* in the C (or C++) standard (*'implementation defined'*, *'reserved for the implementation'*) it refers to the compiler (in the sense of the latter one *'implementing'* the standard). – Aconcagua Nov 28 '21 at 17:54

2 Answers2

2

Function definition etc is a formal term, but "implementation" is a fuzzy informal term. In plain English, it could refer to your application's implementation of something, like for example a function. The implementation phase of a project is typically the phase where you write all the code. And so on - it depends on context.

In formal/technical C programming terms, implementation means the implementation of the C language. That is: formally implementation means the C compiler and standard library. And the formal term implementation-defined behavior means compiler-specific behavior.

Lundin
  • 195,001
  • 40
  • 254
  • 396
1

implementation: if you have some pseudo-code or something like an UML-Diagram and write your code on that basis it's an implementation

declaration: a declaration is already in your code where you say the compiler/interpreter: "hey look there is this variable that I want to use but I dont want to give it any value yet"

and finally definition: definition is when you finally assign a value to your variable like x = 4. Like your defining x to be 4 (in your code)

Hope this is helpful to you