Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!kth!draken!liuida!prosys!ath From: ath@helios.prosys.se (Anders Thulin) Newsgroups: comp.os.minix Subject: Re: A simple question Message-ID: <405@helios.prosys.se> Date: 29 Mar 89 06:30:24 GMT References: <11762@louie.udel.EDU> Organization: Programsystem AB, Linkoping, SWEDEN Lines: 26 In article <11762@louie.udel.EDU> PL147744%TECMTYVM.BITNET@uicvm.uic.edu (Marcela Bonilla J.) writes: >Can anybody tell me what does this instruccion means ? > >" r = (rp - proc) - NR_TASKS " > >rp is a pointer to a structure of type proc and proc is the table of >procedures... =) Quote: "If two pointers to objects of the same type are subtracted, the result is converted (by division by the length of the object) to an int representing the number of objects separating the pointed-to objects. The conversion will in general give unexpected results, unless the pointers point to objects in the same array, since pointers, even to objects of the same type, do not necessarily differ by a multiple of the object length" (rp - proc) produces the index of rp inside the table proc, that is rp == proc[rp-proc]. -- Anders Thulin INET : ath@prosys.se ProgramSystem AB UUCP : ...!{uunet,mcvax}!enea!prosys!ath Teknikringen 2A PHONE: +46 (0)13 21 40 40 S-583 30 Linkoping, Sweden FAX : +46 (0)13 21 36 35