TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Bob Lawrence
from: Geoff Armstrong
date: 1994-05-31 11:10:04
subject: C

Hello Bob!

On 30 May 94, you said to Roy Mcneill:

RM>> char dest[4];
RM>> char *source = "3:711/934.12";
RM>> char *p;

RM>> p = source + 2;
RM>> strncpy (dest, p, 3);
RM>> dest[3] = "\0";

BL> Hi Roy,
BL>         I'm still not on top of pointers. every time I try to use them
BL> I manage to lock the computer. Why can't I define:

BL> char source[16]
BL> strcpy(source,"3:711/934.12");

BL> and then use

BL>   strncpy(dest,source[2],3);

                   &source[2],3);  /* You need the ADDRESS OF source[2] */

Sea Ewes are round!
Geoff.

--- FMail 0.92
* Origin: Point Percy! (Brisbane, Australia) (3:711/934.14)
SEEN-BY: 711/934
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.