TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: James McKenzie
from: Herbert Bushong
date: 1998-10-11 07:55:00
subject: Need to copy

::>  ::>> This is with Borland C++ for OS/2.

::>  HB> BC/2 doesn't have memcpy? I thought it did...   Use memmove()...

::> Ok.  Let me state what happened again.  I tried to use memcpy and I ended

Ok :)   BTW, which version of BC/2?  (I have 2.0)
Also, I never use memcpy(), I always use memmove().

::> with a SYS1808.  Calling the FUNCTION with the same code compiled with Wat
::> C/C++ 10.0a results in the same error message. Something is wrong with eit
::> the structure or the method of accessing the function.

::> The call is 

calc_offered_load (&ex);

::> And the function line is
::> void calc_offered_load (EXPT_DESC_PTR expt)
::> { Code in here }
::> ex is of type EXPT_DESC

::> And the structure ends with:

::> } EXPT_DESC  *EXPT_DESC_PTR

I'll *assume* the definition of the struct was a typedef.

::> which from what I remember makes expt a pointer to the variable ex.

Yes. But, in all the above, you didn't show where memcpy() was used.

just as an example, I'll give you this:

EXPT_DESC ex;
EXPT_DESC ex1;

/* copy ex to ex1 */
memmove(&ex1, &ex, sizeof(EXPT_DESC));

#  Herbert Bushong    harchon{at}centuryinter.net       [TEAM OS/2]    
-  Blackbeard's BBS   herb{at}intelec.com               Intelec: 239:600/0            
+  Fido: 1:19/19      http://www.intelec.com/software/

---
   RM 1.31 2508   Error:  Unknown media type.  Geraldo detected.
* Origin: Blackbeard's BBS - Ville Platte, LA - 318-468-3385 (1:19/19)
SEEN-BY: 396/1 632/0 371 633/210 260 267 270 371 635/506 728 639/252 670/218
@PATH: 19/19 124/7008 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.