🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.help
Article #24

Re: Please help me with Pointers and Structs

#24
From: Peter Seebach
Date: Wed, 22 Nov 1995 20:30
26 lines
1223 bytes
In article <48uf2k$nab@gryphon.phoenix.net>,
Bruce Wedding <brucew@phoenixnet> wrote:
>struct _car {

The problem here is that "_car" is in the implementation's namespace.

>To pass a struct, pass a pointer to it like this:

This is not necessary; ANSI mandates the passing of structs as normal
parameters, as well.

>What else do you need to know?

Worth mentioning:
foo->bar
is the same as
(*foo).bar

-s
p.s.: You should almost always pass pointer-to-struct; it is likely more
efficient.
-- 
Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
C/Unix proto-wizard -- C/Unix questions? Send mail for help.  No, really!
Fund my computing hobby - send money! -- seebs@intran.xerox.com
The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq
Technical Details
Message-ID: <49019m$rvv@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <surgsw-2011951847210001@128.206.206.35> <48uf2k$nab@gryphon.phoenix.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: seebs@solutions.solon.com (Peter Seebach)
Newsgroups: comp.sys.mac.programmer.help,comp.lang.c
Subject: Re: Please help me with Pointers and Structs
Date: 22 Nov 1995 14:30:46 -0600
Organization: Usenet Fact Police (Undercover)
Message-ID: <49019m$rvv@solutions.solon.com>
References: <surgsw-2011951847210001@128.206.206.35> <48uf2k$nab@gryphon.phoenix.net>
NNTP-Posting-Host: solutions.solon.com