Jump to content

doubt?


anmol

Recommended Posts

sir,is prototyping inportant in c++?

 

Seeing as noone else is answering this, I'll try and provide something.

It's been a while since I did anything C, and even then I was fairly ameturish -- so take this with a grain of salt, I may not even be explaining the right concept:

 

 

Function prototypes are used to inform the compiler that you've defined the function elsewhere in your program.

They allow you to get the full declaration of the function out of where you define it and put it somewhere more meaningful for a human user, so they're good for structuring the code and making it readable.

Link to comment
Share on other sites

Function prototyping are important when:

 

-- you are separating your library into an interface .h and a source .cpp

 

-- you need to use the functions before you are defining them

 

-- when you are using RMI over C++, to offer a Sink

 

-- prototypes are important in definition files (advanced)...

 

-- prototypes are important when using a Dynamic-Linked Library (DLL), where you have to define the function that will later

be used as a pointer to the definition within the caller (advanced)...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.