Thread View: cn.bbs.comp.program
1 messages
1 total messages
Started by Rodge
Sun, 10 Oct 1999 00:00
Re: C������������
Author: Rodge
Date: Sun, 10 Oct 1999 00:00
Date: Sun, 10 Oct 1999 00:00
56 lines
1833 bytes
1833 bytes
> [1;36m==> Air_Jet(����) ˵��: [37;40m[0m
> ������һ�������ⲿ����ij�������
> ��дһ������������ӳ������õ�����
> ��ͷ�ļ���ȫ�ֱ�����ͷ�ļ�(Globals.h)
> �����������ļ��У������ⲿ������ļ�
> ��Ͳ��ٰ���Ӧ�����ݡ�
>
> �ʣ�Ӧ�����д������Ŀ�ͷ����ʹ����
> ͨ����ֺ���δ�������ظ�����Ĵ���
add HEADER FILE PROTECTION:
#ifndef ******
#define ******
...
..
#endif
> ��
> ������Ϊ 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