函数声明和定义在不同的文件夹下的使用
来源:互联网 发布:js中将string转为int 编辑:程序博客网 时间:2024/05/06 01:38
首先得建立一个工程,将这些文件都放到一个工程下面
- 建立头文件ning.h
内容为:
#ifndef _NING_
#define _NING_
#include<iostream>
using namespace std;
int ning(long *a);
#endif
2. 建立源文件ning. cpp
内容为:
#include"ning.h"
int ning(long *a)
{
cout<<*a<<endl;
}
3. 建立主文件main.cpp
#include <cstdlib>
#include <iostream>
#include "ning.h"
using namespace std;
int main(int argc, char *argv[])
{
long a;
cin>>a;
ning(&a);
system("PAUSE");
return EXIT_SUCCESS;
}
4.编译连接即可运行了
- 函数声明和定义在不同的文件夹下的使用
- 函数的声明和定义
- 函数的声明和定义
- 函数的声明和定义
- 函数的声明和定义
- 函数的声明和定义
- 函数的声明和定义
- 声明与定义的不同
- 变量和函数的定义和声明
- 全局函数的声明和定义
- 内联函数的声明和定义
- 内联函数的声明和定义位置
- 变量,函数的定义和声明
- c_函数的声明和定义
- 内联函数的声明和定义
- 函数的定义、声明、初始化和赋值
- 函数的声明、定义和调用
- 【转】函数的声明和定义
- vs2008安装部署软件过程
- 新的开始,加油啦!!
- Oracle 系统表大全
- JAVA DOM4J解析XML
- WCF中的ABC
- 函数声明和定义在不同的文件夹下的使用
- [IT168]解析RAID技术基础知识及应用
- 黑马程序员-java基础 io字符流
- GetCurrentDirectory function
- WIN CE6 platform和smart device开发,安装顺序
- Fedora 17 安装nVidia显卡驱动(禁用自带nouveau驱动)
- Displaying Bitmaps Efficiently
- phonics-2
- 关于浮点数的比较