Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by ����
Sun, 10 Oct 1999 00:00
C������������
Author: ����
Date: Sun, 10 Oct 1999 00:00
Date: Sun, 10 Oct 1999 00:00
48 lines
1556 bytes
1556 bytes
������һ�������ⲿ����ij�������
��дһ������������ӳ������õ�����
��ͷ�ļ���ȫ�ֱ�����ͷ�ļ�(Globals.h)
�����������ļ��У������ⲿ������ļ�
��Ͳ��ٰ���Ӧ�����ݡ�
�ʣ�Ӧ�����д������Ŀ�ͷ����ʹ����
ͨ����ֺ���δ�������ظ�����Ĵ���
��
������Ϊ test.c
ͷ�ļ�Ϊ globals.h
�ӳ���ֱ�Ϊ��function1.c, function2.c,...
//test.c�����ݣ�
#include "globals.h"
extern void f1(void);
extern void f2(void);
void main(void)
{
i = 1;
j = 2;
f1();
f2();
printf("%d\r\n",k);
}
//globals.h������:
#include "stdio.h"
extern int i, j, k;
//function1.c�����ݣ�
void f1(void)
{
k = i + j;
printf("%d\r\n",k);
}
//function2.c�����ݣ�
void f2(void)
{
k = i - j;
}
--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads