[comp.sys.amiga.programmer] Help with EXTERN statement in C!!!!

slmt9@cc.usu.edu (06/09/91)

	This is a plea for help with C. The problem is in getting an external
variable to work. I defined a character array like this

	char names[5][20]={"name1","name2","name3","name4","name5"};

	I then try to make this an extern variable from a section of code that
I am compiling seperately. Well it does not work at all. I have tried to 
declare it in several ways and still I can not get it too work. Anyway Any and
All help would be greatly appriciated.

	Thanks,
	Joshua
	SLMT9@cc.usu.edu

johnhlee@CS.Cornell.EDU (John H. Lee) (06/10/91)

In article <1991Jun9.132518.48043@cc.usu.edu> slmt9@cc.usu.edu writes:
>	This is a plea for help with C. The problem is in getting an external
>variable to work. I defined a character array like this
>
>	char names[5][20]={"name1","name2","name3","name4","name5"};
>
>	I then try to make this an extern variable from a section of code that
>I am compiling seperately. Well it does not work at all. I have tried to 
>declare it in several ways and still I can not get it too work. Anyway Any and
>All help would be greatly appriciated.

"extern char names[5][20]" should work.  What kind of errors are you getting?

-------------------------------------------------------------------------------
The DiskDoctor threatens the crew!  Next time on AmigaDos: The Next Generation.
	John Lee		Internet: johnhlee@cs.cornell.edu
The above opinions are those of the user, and not of this machine.

NJ_GOKEMEIJE@FANDM.BITNET (06/10/91)

From:   IN%"johnhlee@cs.cornell.edu"  "John H. Lee" 10-JUN-1991 01:06:48.85
To:     amiga-programmer-relay@udel.edu
CC:
Subj:   RE: Help with EXTERN statement in C!!!!

Return-path: <amiga-programmer-relay-request@udel.edu>
Received: from JNET-DAEMON by FANDM with PMDF#10102; Mon, 10 Jun 1991 01:03 EST
Received: From CORNELLC(MAL) by FANDM with Jnet id 5358 for NJ_GOKEMEIJE@FANDM;
 Mon, 10 Jun 91 01:03 EST
Received: from CORNELLC by CORNELLC (Mailer R2.08A) with BSMTP id 6146; Sun, 09
 Jun 91 21:03:18 EDT
Received: from udel.edu by CORNELLC.cit.cornell.edu (IBM VM SMTP R1.2.2MX) with
 TCP; Sun, 09 Jun 91 21:03:17 EDT
Received: from louie.udel.edu by louie.udel.edu id ad28568; 9 Jun 91 20:13 EDT
Received: from USENET by louie.udel.edu id aa28558; 9 Jun 91 20:10 EDT
Received: from snow-white.ee.udel.edu by louie.udel.edu id ac28532; 9 Jun 91
 20:09 EDT
Received: from nigel.ee.udel.edu by snow-white.ee.udel.edu id ac02474; 10 Jun
 91 0:07 GMT
Date: 9 Jun 91 23:53:52 GMT
From: "John H. Lee" <johnhlee@cs.cornell.edu>
Subject: RE: Help with EXTERN statement in C!!!!
Sender: amiga-programmer-relay-request@udel.edu
To: amiga-programmer-relay@udel.edu
Message-id: <1991Jun9.235352.15367@cs.cornell.edu>
Newsgroups: comp.sys.amiga.programmer
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
Nntp-Posting-Host: fulla.cs.cornell.edu

In article <1991Jun9.132518.48043@cc.usu.edu> slmt9@cc.usu.edu writes:
>       This is a plea for help with C. The problem is in getting an external
>variable to work. I defined a character array like this
>
>       char names[5][20]={"name1","name2","name3","name4","name5"};
>
>       I then try to make this an extern variable from a section of code that
>I am compiling seperately. Well it does not work at all. I have tried to
>declare it in several ways and still I can not get it too work. Anyway Any and
>All help would be greatly appriciated.

"extern char names[5][20]" should work.  What kind of errors are you getting?

-------------------------------------------------------------------------------
The DiskDoctor threatens the crew!  Next time on AmigaDos: The Next Generation.
        John Lee                Internet: johnhlee@cs.cornell.edu
The above opinions are those of the user, and not of this machine.