www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/12/18/15:09:59

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <20011218200551.38218.qmail@web13907.mail.yahoo.com>
Date: Tue, 18 Dec 2001 12:05:51 -0800 (PST)
From: Chris Amos <homie_dont_play_dat AT yahoo DOT com>
Subject: *Newbie= Why isn't this small function working correctly?
To: List DJGPP <djgpp AT delorie DOT com>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

It has to be a logic error of some kind because the code runs fine
aside from a few warning messages...

-----------------------------------------------------------------------

/* This is a memmory string cut function.
   *string = pointer to the string were cutting from
   *new_string = pointer to the memmory where the 'cut' string will go
   start_offset = Where we will start cutting >= 0
   end_offset = Where we will stop cutting  >= start_offset            
*/
void getstr(const char *string, const char *new_string, int
start_offset, int end_offset);

/**************************************************************************/
void getstr(const char *string, const char *new_string, int
start_offset, int end_offset)
{
  int i=0;
  int b=0;

  for (i=start_offset; i<=end_offset; i++) {
    *(new_string+b)=string+i;
    b++;
  }
  *(new_string+b)='\0';
  return;
}

=====
~ Twisted Matrix (Founder of ULTRATECH)

URL: N/A
ICQ: 74628745

__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

- Raw text -


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