Do objects and instances mean something else for an imperative language like C compared to an object-oriented? [closed]

StackOverflow https://stackoverflow.com/questions/14616785

  •  06-03-2022
  •  | 
  •  

Question

I read that a running C program can be referred to as an "instance". Is this really correct? The word instance is usually used for OOP. And C also has "objects" hasn't it, but it's not the same as in OOP. An "object" in C is just something in memory like a union with some value could be called an object can't it?

Was it helpful?

Solution

An "object" in C is just something in memory, but that's also true of all computer languages.

An object in real life is a thing that physically exists. Being in memory is the closest something in a program can come to physical existence, so we apply the same term.

An instance in real life is a specific example of a generic concept. The term has similar generality in computers. When you tell the computer to run a program, it generates an instance of that program, among many potential instances of running that program. Again, nothing specific to C, this terminology usually occurs in operating systems (which manage running of programs, and define what a "program" is).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top