www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/20/19:40:34

Message-ID: <3744C077.8A80A90E@rocketmail.com>
From: Denis Lamarche <brainwav AT rocketmail DOT com>
Organization: @Home Network
X-Mailer: Mozilla 4.05 [en]C-AtHome0404 (Win95; U)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: How can I...
Lines: 30
Date: Thu, 20 May 1999 23:12:55 GMT
NNTP-Posting-Host: 24.112.228.171
X-Complaints-To: abuse AT home DOT net
X-Trace: news2.rdc1.on.home.com 927241975 24.112.228.171 (Thu, 20 May 1999 16:12:55 PDT)
NNTP-Posting-Date: Thu, 20 May 1999 16:12:55 PDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

if I have this:
char *names[4]={"james", "rob", "mike", "denis"};
char *words[2]={"house", "market"};

how would I make a function that would assign a pointer to represent one
of these two (names or words) depending on a number....sorta like this

char Do_It(int type)
{
[what kind of variable do I declare here??]
char **strings;   //????

if (type==0)
  [Then assign pointer to names]
else if (type==1)
  [Then assign same pointer to words]


return 0;
}

how would I assign it......the way I was doing it (i think its wrong) is
strings=words;
or strings=names;

but that causes errors...crashes..



Denis Lamarche

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019