delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/25/23:39:24

Date: Tue, 25 Aug 1998 23:39:21 -0400 (EDT)
Message-Id: <199808260339.XAA06648@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: matthew DOT krause AT juno DOT com
CC: djgpp AT delorie DOT com
In-reply-to: <19980825.232445.3854.3.matthew.krause@juno.com>
Subject: Re: Structure ->Structure [?mildly offtopic] and other Newbie Concerns

> 	1. How may I copy one structure over another? Example: Given
> default(a struct) and current(a struct of the same type) can a simply say
> current=default?

Yes.  Beware that if your structure has pointers in it, it copies the
pointers - not the contents of what they point to!  Beware of memory
problems when destructing these structures.

> 	2.How may I compare the contents of two structures find out which
> fields differ between them? IE given current and default, I want to know
> that settings.a is different? Is there a way to do to that easier than
> comparing each field?

No, you have to compare each field.

> 	3.  I know that C and C++ files can be compiled and then linked
> together to form one *.exe file. Is that good form?

Depends on the needs of your project.  There are no technical reasons
not to mix languages, but you have to be careful to do it correctly.

> 	4. Legal Question: If I use a function from code which is GPLed,
> must I distrubute the source to all of my program, or just that function?

If it's GPL, your entire program.  If it's LGPL, just that file, but
you must also distribute whatever is required to replace your version
of the compiled version of that LGPL file with something they compile
with their modified version of that LGPL file.  Usually, this means
you ship objects.

- Raw text -


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