PracticeDev/study_cpp/cpp_primer_source_code/Chapter 7/calling.cpp

22 lines
483 B
C++
Raw Permalink Normal View History

2022-12-20 17:31:11 +08:00
// calling.cpp -- defining, prototyping, and calling a function
#include <iostream>
void simple(); // function prototype
int main()
{
using namespace std;
cout << "main() will call the simple() function:\n";
simple(); // function call
cout << "main() is finished with the simple() function.\n";
// cin.get();
return 0;
}
// function definition
void simple()
{
using namespace std;
cout << "I'm but a simple function.\n";
}