🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2304

void* type

#2304
From: Huayong Yang
Date: Sat, 16 Mar 1996 16:22
21 lines
837 bytes
I know void* means an arbitrary pointer. In an interview, I was asked to
write a routine that swaps two pointers.

I tried with this

void Swap(void** p1, void** p2)
{
  void* p = *p1;
  *p1 = *p2;
  *p2 = *p;
}

but it is not correct, because void* is not allowed as operand.

How should I do?

--
Huayong

WWW home pages:                           Email:
http://www.math.umass.edu/~yang           yang@math.umass.edu
Technical Details
Message-ID: <4iepre$ag7@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: yang@math.umass.edu (Huayong Yang)
Newsgroups: comp.lang.c.moderated
Subject: void* type
Date: 16 Mar 1996 10:22:06 -0600
Organization: UMass/Amherst Dept Math & Stats
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4iepre$ag7@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: Tin 1.1 PL362948