From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA23852; Fri, 23 Apr 2004 01:34:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA23690 for ; Fri, 23 Apr 2004 01:34:36 +0200 (MET DST) Received: from hotmail.com (bay7-f22.bay7.hotmail.com [64.4.11.22]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3MNYYYM019500 for ; Fri, 23 Apr 2004 01:34:35 +0200 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 22 Apr 2004 16:34:33 -0700 Received: from 66.141.17.195 by by7fd.bay7.hotmail.msn.com with HTTP; Thu, 22 Apr 2004 23:34:33 GMT X-Originating-IP: [66.141.17.195] X-Originating-Email: [writetosafi@hotmail.com] X-Sender: writetosafi@hotmail.com From: "mohammad siddiqui" To: skaller@users.sourceforge.net Cc: rich@annexia.org, caml-list@inria.fr Subject: [Caml-list] help Date: Thu, 22 Apr 2004 23:34:33 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 22 Apr 2004 23:34:33.0789 (UTC) FILETIME=[5DEE6ED0:01C428C2] X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pointers:01 struct:01 struct:01 model:01 model:01 arrays:01 typedef:01 typedef:01 ocaml:01 ocaml:01 blocking:01 inner:02 pointer:03 pointer:03 array:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I am involved in a conversion project, where we are translating programs from C to ocaml. I am having hardtime dealing with pointers. One of the structures contains a pointer to a structure as one of its fields, which in turns contains a pointer to another structure, I replaced this by using arrays in ocaml but I am not able to make changes to inner structures fields (using Array.set ) if i do so it changes the values of all the elements of that array. Can any one help resolving this? The structures in C are below: typedef struct word { FNUM wnum; /* word number */ FVAL weight; /* word weight */ } WORD; typedef struct doc { long docnum; /* Document ID. This has to be the position of the document in the training set array. */ long queryid; double costfactor; double twonorm_sq; WORD *words; /* The words/values in the document by */ /*increasing word-number. I replaced this by an array in ocaml*/ } DOC; typedef struct model { long sv_num; long at_upper_bound; double b; DOC **supvec; /* I replaced this by array of type doc in ocaml */ double *alpha; } MODEL; I am unable to change the values for an example How can I change the value od model.supvec[i].words[i].wnum? Thanks, Mohammad S Siddiqui. _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.com/go/onm00200415ave/direct/01/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners