C++的编程模块
Posted 吻等离子
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++的编程模块相关的知识,希望对你有一定的参考价值。
一、程序清单
calling.cpp
// 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";
输出结果:
main() will call the simple() function:
I\'m but a simple function.
main() is finished with the simple() function.
protos.cpp
// protos.cpp -- using prototypes and function calls
#include <iostream>
void cheers(int); // prototype: no return value
double cube(double x); // prototype: returns a double
int main()
using namespace std;
以上是关于C++的编程模块的主要内容,如果未能解决你的问题,请参考以下文章