Version française
Home     About     Download     Resources     Contact us    
Browse thread
printf and positional specifier
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Peter Gregory <Peter.Gregory@c...>
Subject: Re: [Caml-list] printf and positional specifier
Anastasia Gornostaeva wrote:
> Hello.
> 
> $ ocaml
>         Objective Caml version 3.09.3
> 
> # open Printf;;
> # printf "%2$d %1$s" "abc" 2;;
> Bad conversion %$, at char number 0 in format string ``%2$d %1$s''
> 
> 
> How?
> 
> ermine
> 

Hi Ermine,

I'm not sure that I understand your question.  I think to achieve what 
you seem to be trying, you would simply write:

# printf "%d %s" 2 "abc";;

You just put the parameters in the order they came in the string.  Does 
that help, it seems like perhaps you needed more than that.

Regards,
Peter.