caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Nuutti Kotivuori <naked+caml@naked.iki.fi>
To: "André Luiz Moura" <aluizmoura@yahoo.com.br>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Value of the address of a pointer
Date: Tue, 24 Feb 2004 17:19:23 +0200	[thread overview]
Message-ID: <87ishw7bes.fsf@naked.iki.fi> (raw)
In-Reply-To: <20040220172906.7855.qmail@web60603.mail.yahoo.com> (Andr's message of "Fri, 20 Feb 2004 14:29:06 -0300 (ART)")

Andr wrote:
> Please, it would like to know as to get in OCaml the value of the
> address of memory of a pointer, as it occurs in the example in C
> that follows:

You cannot obtain a pointer to a certain element in an array in
OCaml. And in any case it does not make sense unless you plan on
modifying the element.

If you do plan on modifying it, you will either have to carry both the
array itself and an index to the element inside it separately - or you
will have to have an array of references to values and use it
accordingly then.

I'm a relative OCaml newbie though, so hopefully someone will correct
me if I am wrong.

-- Naked

-------------------
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


      reply	other threads:[~2004-02-24 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-20 17:29 André Luiz Moura
2004-02-24 15:19 ` Nuutti Kotivuori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ishw7bes.fsf@naked.iki.fi \
    --to=naked+caml@naked.iki.fi \
    --cc=aluizmoura@yahoo.com.br \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).