Click here to Skip to main content
15,887,376 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is this executing something or saying something? What is it called?
void result(QString data);

What I have tried:

Is this executing something or saying something? What is it called?
void result(QString data);
Posted
Updated 5-Dec-20 19:56pm
Comments
Richard MacCutchan 6-Dec-20 3:40am    
Still not learned C/C++ then?

This is function declaration. It is not 'doing anything'.
C++
void result(QString data);

This is an example of calling the result function.
C++
QString data = "Hello World";
result(data);
 
Share this answer
 
It's a function declaration that is used either in a header file to provide the signature for external functions (i.e. not in this file, but in another or in a library) so it can be called from your code; or to give the signature for a function before the actual definition of the function so it can be used by other functions (this is known as a forward declaration).

For example, if you have two functions that call each other:
C++
void A()
   {
   B();
   }
void B()
   {
   A();
   }
Then you need at least one forward declaration (of B) or it's signature is not known when it is first called.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900