answersLogoWhite

0

A forward declaration is simply a declaration of an identifier that will be defined at a later point during compilation. It is quite common to separate declarations from their definitions using header files (.h) and source files (.cpp). The header essentially contains all the forward declarations of all the definitions contained in the source file.

It is also common practice to use forward declarations when a header contains pointers to a type, rather than references. If it includes references, then you must include the header file for those references, but if they are pointers then you only need a forward declaration of the type (before it is used) and the actual header that contains the full declaration can be included in the source file instead.

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering
Related Questions

In c plus plus Who tells the compiler that a specific class will be declared later in the program?

A forward declaration. However forward declarations can only be used when the class is used as a pointer or reference prior to its definition, otherwise it must be defined before it is used. class A; // forward declaration class B { A& data; // reference to class that has yet to be defined }; class A {}; // definition


In c plus plus are local declarations visible to the function in a program?

If you declare a variable inside of any fuction (except main) it will not be available to other functions.


What is an ordered list of data structure using c plus plus?

An ordered list of data in any programming language is simply a sorted array or list. In C++ this can either mean a sorted array, vector, list or forward list.


What is the purpose of the header file io.h in c plus plus?

The header, io.h, is part of the standard C library and contains declarations for file handling and I/O functions. The file has no practical purpose in C++; it is only included because it was required prior to C++ standardisation. However, it can be used when writing C-style programs and libraries in C++.


What is the mean c plus plus in machine code?

It is used to distinguish between the C or C++


What is the function of stdlibh in c language?

It contains useful declarations.


What is a backwards L forward C backward C forward L mean in numbers?

In numbers, a "backwards L" typically represents the number 7, a "forward C" represents the number 3, and a "backward C" represents the number 6. A "forward L" can represent the number 1. Therefore, the sequence "backwards L forward C backward C forward L" translates to 7, 3, 6, 1.


In C plus plus Interface is also known as?

I guess you mean Java, there is no interface in C++.


What is iosteram in c plus plus?

The <iostream> include file is a header file that contains the prototype declarations of functions that provide the basic input/output mechanisms in C++. The <iostream> header file sets up the objects that initialize the basic input/output pathways, cout and cin.


How do you rectify braces expected error in c plus plus language?

This type of error indicates you've omitted braces where braces were expected. For instance, class declarations must be enclosed within curly braces, as must function definitions.


What does c mean in y equals mx plus c?

c is any constant value


What does B plus A mean at bottom of a letter?

b=2 a=1 c=3 so b plus a =c