caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Printf.sprintf and string_of_float
@ 2003-10-02 14:16 matthieu.dubuget
       [not found] ` <3F7C3696.5090608@stratos-ad.com>
  0 siblings, 1 reply; 2+ messages in thread
From: matthieu.dubuget @ 2003-10-02 14:16 UTC (permalink / raw)
  To: caml-list

Hello.

I'm still using Ocaml 3.06.

I have a C program calling Ocaml functions.
As soon as I introduce Printf.sprintf function,
for example with:

let unused_later = Printf.sprintf "string" () ;;

Everything compiles normally, but when I run the program,
I obtain a definitive :

L'instruction à "0x..." emploie l'adresse mémoire "0X...".
La mémoire ne peut être "read".

I have really no idea in which direction to investigate to
solve this problem. Any idea?

Thanks in advance

Matthieu Dubuget

********** L'ADSL A 20 EUR/MOIS********** 
Avec Tiscali, l'ADSL est à 20 EUR/mois. Vous pourrez chercher longtemps avant de trouver moins cher ! 
Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/
Offre soumise à conditions.


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Printf.sprintf and string_of_float
       [not found] ` <3F7C3696.5090608@stratos-ad.com>
@ 2003-10-02 14:53   ` Matthieu Dubuget
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Dubuget @ 2003-10-02 14:53 UTC (permalink / raw)
  To: samsaga2; +Cc: caml-list

samsaga2 a écrit :
> Why are you passing a unit to sprintf?
> 
> let unused_later = Printf.sprintf "string";;
> 
> let string_of_float (float_number : float) = Printf.sprintf "%f" 
> float_number;
> 
> This is ok for me

You are right, this was a typo in the mail. The line really added is

let unused_later = Printf.sprintf "string" ;;

But this is just an example. I just have to use Printf module
to crash my program.

The following line added in the ml file used to generate my lib/dll is another example:

let unused a = Printf.printf "%f" ;; 

Matthieu Dubuget

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-02 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-02 14:16 [Caml-list] Printf.sprintf and string_of_float matthieu.dubuget
     [not found] ` <3F7C3696.5090608@stratos-ad.com>
2003-10-02 14:53   ` Matthieu Dubuget

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