🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #240

Re: C������������

#240
From: �ܽ�
Date: Sun, 10 Oct 1999 00:00
52 lines
1453 bytes
> ==> Air_Jet(����)                            ˵��: 
�ȽϹ淶��������

// globals.h
#ifndef GLOBALS
#define GLOBALS              // ��ֹ�����γ���

#include <stdio.h>           // ��<>����ָϵͳ��ͷ�ļ� 
extern int i,j,k;            //��ijһ���ļ��ж��壬����ֻ��������Щ����
extern void f1(void);
extern void f2(void);

#endif

// test.c
#include "globals.h"        // ��""��ָ�Լ������ͷ�ļ�
int i,j,k;                  // ʵ�ʶ������
void main()
{
   i = 1;
   j = 2;
   f1();
   f2();
   printf("%d\r\n",k);
}


// f1.c
#include "globals.h"
void f1(void)
{
   k = i + j;
   printf("%d\r\n",k);
}


// f2.c
#include "globals.h"
void f2(void)
{
   k = i - j;
}


��UNIX�¿���д���µ�makefile

all:test
test:test.o f1.o f2.o
	gcc -o test test.o f1.o f2.o

--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID: <991010.11a9HB$PBBS@bbs.ustc.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: fc86e,e47664455b8e7def
X-Google-Attributes: gidfc86e,public
From: James_Zhang@bbs.ustc.edu.cn (�ܽ�)
Subject: Re: C������������
Date: 1999/10/10
Message-ID: <991010.11a9HB$PBBS@bbs.ustc.edu.cn>
X-Deja-AN: 536367844
Distribution: ustc
Organization: �й�ƴ�BBSվ
Newsgroups: cn.bbs.comp.program