From owner-freebsd-questions@FreeBSD.ORG Tue Feb 1 19:32:58 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A023816A4CE for ; Tue, 1 Feb 2005 19:32:58 +0000 (GMT) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A84443D46 for ; Tue, 1 Feb 2005 19:32:58 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (8.12.6/MantshX 2.0) with ESMTP id j11JWiVG022800; Tue, 1 Feb 2005 11:32:49 -0800 (PST) Received: from [10.1.1.245] (nfw2.codefab.com [199.103.21.225] (may be forged)) (authenticated bits=0)j11JWf2p005618; Tue, 1 Feb 2005 11:32:44 -0800 (PST) In-Reply-To: <20050201164337.GA78979@dogma.freebsd-uk.eu.org> References: <20050201164337.GA78979@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <62f97b906f93154c70f01d754d50083c@mac.com> Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Tue, 1 Feb 2005 14:32:41 -0500 To: Jonathon McKitrick X-Mailer: Apple Mail (2.619.2) cc: freebsd-questions@freebsd.org Subject: Re: Unix equivalent of a variant?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2005 19:32:58 -0000 On Feb 1, 2005, at 11:43 AM, Jonathon McKitrick wrote: > I need the equivalent of a variant, however. A hold-everything > variable > that can be any type in C/C++. Is there something already out there I > can > use or should I just roll my own? Your question probably belongs on comp.lang.c, but the cannonical way of handling "data of any type" is a memory buffer and a (void *). Watch out for host data alignment restrictions. -- -Chuck