Search code examples
forward-declarationforward-reference

What is the difference between forward declaration and forward reference?


What is the difference between forward declaration and forward reference?

Forward declaration is, in my head, when you declare a function that isn't yet implemented, but is this incorrect? Do you have to look at the specified situation for either declaring a case "forward reference" or "forward declaration"?


Solution

  • From Wikipedia:

    Forward Declaration

    Declaration of a variable or function which are not defined yet. Their defnition can be seen later on.

    Forward Reference

    Similar to Forward Declaration but where the variable or function appears first the definition is also in place.