Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
this is my code:
function a()
{


}
Posted

Given that it does nothing, it works pretty well. Apart from not compiling, of course.

Try this:
C++
void a()
   {
   }
Since it returns nothing, it should have a void type - C++ does not have a keyword for functions, you just declare the return type.

Then just call it:
C++
a();

Mind you, given that it doesn't actually do anything, you could leave the call out and have pretty much the same affect...
 
Share this answer
 
The following is not a function in C++ :
PHP
function a()
{

}



See : http://thenewboston.org/watch.php?cat=16&number=9[^]

BTW, you should get a C++ book and read.
 
Share this answer
 
 
Share this answer
 
Here You will find the basics of functions.


http://www.tutorialspoint.com/cplusplus/cpp_functions.htm[^]
 
Share this answer
 
hi,
you can use this links to use userdefined function:
http://www.macs.hw.ac.uk/~pjbk/pathways/cpp1/node159.html[^]
and
http://www.cplusplus.com/forum/beginner/41973/[^]
good luck
 
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