delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/18/06:35:55

From: Gal <wribak AT usa DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: - HELP! - a little mixed up in C/C++ pointers
Date: Mon, 18 Aug 1997 00:14:10 -0700
Organization: Spamless Society
Lines: 31
Message-ID: <33F7F642.30B9@usa.net>
Reply-To: wribak AT usa DOT net
NNTP-Posting-Host: lap-ca1-24.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Okay here I start:


// defining types variables
struct IndexFileName {
  char FileName[12];
}

int IndexFileName;


// our function
int compare (char *FileName)
{
  return strcmp(Index.FileName, FileName);
}


//main
void main ()
{
  printf("%d\n", compare("TEST.TST"));
  return 0;
}


--------

   The question is, what do I have to put in front of "Index.FileName"
in order to have it become a pointer so I can do a compare?  I'm a bit
mixed up in C :)

- Raw text -


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