From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c4d884378fc6b03c X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Two questions Date: 1996/11/09 Message-ID: <561dfo$h2g@news2.delphi.com>#1/1 X-Deja-AN: 195453950 organization: Delphi Internet Services Corporation newsgroups: comp.lang.ada Date: 1996-11-09T00:00:00+00:00 List-Id: > (1) Is there an easy way to achieve the same result of the C++ > sprintf function in Ada? The Ada idiom for char str[20]; sprintf(&str, "variable %s = %d", name, x); would be something like: declare str:constant string := "variable " & name & " =" & integer'image(x); begin ... Or, since you can return whole strings from functions, you can have ... return "variable " & name & " =" & integer'image(x);