Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] help
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: mohammad siddiqui <writetosafi@h...>
Subject: [Caml-list] help
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 
a pointer to another structure, I replaced this by using arrays in ocaml but 
am not able to make changes to inner structures fields (using Array.set ) if 
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 */

typedef struct doc {
  long    docnum;              /* Document ID. This has to be the position 
                                  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;


I am unable to change the values for an example How can I change the value 


Mohammad S Siddiqui.

FREE pop-up blocking with the new MSN Toolbar – get it now!

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: