🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4676

memcpy

#4676
From: Geoffrey Wong
Date: Fri, 19 Jan 1996 02:43
41 lines
2318 bytes
Can memcpy cope with very complex objects?

How about the following one:-
>struct _rlgg_rec        
>{                       
>    SLiteral    head;   
>    SLiteral    *body;  
>    int         size;   
>};                      
                        

and...


>struct _slit_rec                                                            
>{                                                                           
>       char            Sign;           /* 0=negated, 1=pos, 2=determinate */           
>       Relation        Rel;                                                        
>       Const           *Constants; /* During an rlgg process Constant and Var is   
>                                   coded using the same data type. This is     
>                                   possible since Const is larger than Var! */ 
>       Which           *ConstVar;      /* 0=const, 1=Var  for each Constants */        
>       int             WeakLits;       /* value up to this literal */                      
>       Ordering        *ArgOrders,     /* recursive lits: =, <, >, # */                
>                       *SaveArgOrders; /* copy during pruning */                       
>       float           Bits;           /* encoding length */                           
>};                                                                          
                                                                            
>typedef struct _slit_rec       *SLiteral,      /* Used in rlgg */   
>                               **SClause;      /* Allowing for const in         
                                                   Literal */                       
if I have some thing with the type struc _rlgg_rec can I just memcpy them?
or do I need to assign each item at a time?

If I can memcpy then do I need to allocate space for the destination variable
of type _rlgg_rec with malloc before I memcpy?

How do I do that?

Geoff
.
Technical Details
Message-ID: <4dn0gu$itc@mirv.unsw.edu.au>
Path: arc1-ca.pugleaf.net!unsw.edu.au!gwong

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!unsw.edu.au!gwong
From: gwong@cse.unsw.edu.au (Geoffrey  Wong)
Newsgroups: comp.std.c
Subject: memcpy
Date: 19 Jan 1996 02:43:42 GMT
Organization: University of New South Wales
Message-ID: <4dn0gu$itc@mirv.unsw.edu.au>
NNTP-Posting-Host: thesis.circus.cse.unsw.edu.au
X-Newsreader: TIN [version 1.2 PL2]