1. 新建工作区 命名
新建工程 命名 添加到当前工作空间
工程 增加到工程 文件 .c文件
F7 连接键 执行键
2. 新建工程 命名
工程增加到工程 文件 .c文件
F7 连接键 执行键
3.用编译器编写头文件(不带main的);
用#include"dhfj.h"
2013.4.16
以上的连接不算吧!
连接有三种
1.obj+obj的(预处理已经搞定的啦,不用头文件)
2.cpp+cpp+hao.h;(对应的文件有该头文件即可,但是在加载时不用把它加载到工程里)
3.cpp+obj(若cpp中用到头文件则对应的文件夹里应该包含用到的头文件,但是在加载时不用把它加载到工程里)
以下是实验的程序
#ifndef HAO_H
#define HAO_H
#define SIZE 1000
int is_huiwen(long a);
#endif
#include<stdio.h>
#include"hao.h"
int main(){
int i;
int j;
long m;
for(i=100;i<SIZE;i++)
for(j=100;j<SIZE;j++)
{
m=i*j;
if(is_huiwen(m)>1000)
{
printf("%d*%d=%d\n",i,j,m);
}
}
}
#include<stdio.h>
#include"hao.h"
int is_huiwen(long a)
{
long r=0,temp,b=a;
while(a)
{
temp=a%10;
r=r*10+temp;
a=a/10;
}
return ((r==b)+SIZE);
}
新建工程 命名 添加到当前工作空间
工程 增加到工程 文件 .c文件
F7 连接键 执行键
2. 新建工程 命名
工程增加到工程 文件 .c文件
F7 连接键 执行键
3.用编译器编写头文件(不带main的);
用#include"dhfj.h"
2013.4.16
以上的连接不算吧!
连接有三种
1.obj+obj的(预处理已经搞定的啦,不用头文件)
2.cpp+cpp+hao.h;(对应的文件有该头文件即可,但是在加载时不用把它加载到工程里)
3.cpp+obj(若cpp中用到头文件则对应的文件夹里应该包含用到的头文件,但是在加载时不用把它加载到工程里)
以下是实验的程序
#ifndef HAO_H
#define HAO_H
#define SIZE 1000
int is_huiwen(long a);
#endif
#include<stdio.h>
#include"hao.h"
int main(){
int i;
int j;
long m;
for(i=100;i<SIZE;i++)
for(j=100;j<SIZE;j++)
{
m=i*j;
if(is_huiwen(m)>1000)
{
printf("%d*%d=%d\n",i,j,m);
}
}
}
#include<stdio.h>
#include"hao.h"
int is_huiwen(long a)
{
long r=0,temp,b=a;
while(a)
{
temp=a%10;
r=r*10+temp;
a=a/10;
}
return ((r==b)+SIZE);
}