All of my initial programming experience has been in object-oriented languages (Java, Python). I am now learning C, and it seems that there are still things that resemble objects.
Say for example, a FILE
pointer created with the standard C library. This is just a pointer to the memory location of a struct
. Is this essentially the same thing as an object in OO languages?
There are existing questions asking about the difference between a struct
and a class
, but I'm asking about how a program uses those things. A struct
is used or accessed via a pointer, while an object
is a particular instance of a class. In this sense, it seems that a class
is more general than a struct
. Though I really only added this paragraph to prevent this questions from being marked as a duplicate, and it strays from my original question.
If a FILE
pointer is, indeed, comparable to some FILE
object in a different language, then where is the key difference between how that "thing" called FILE
will be handled in a object-oriented language vs a non-object-oriented language. Seems like the line starts to blur.