Re: [Vala] printing int64 value to standard output



On Mon, 14 May 2012 14:14:47 -0400
"D.H. Bahr" <dbahr uci cu> wrote:

Thanks!!
El lun, 14-05-2012 a las 10:20 -0700, Abhijit Hoskeri escribió:
On Mon, May 14, 2012 at 10:09 AM, D.H. Bahr <dbahr uci cu> wrote:
Hello there, how can I print an int64 variable to stdout??

int64 timestamp = 1234151912;
stdout.printf("%?", timestamp);


%lld is the format string you need.

Regards,
Abhijit

10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS
INFORMATICAS... CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION

http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci


Another option is to use Vala string templates:
int64 timestamp = 1234151912;
stdout.printf(@"$timestamp\n");

more examples of using string templates is available at:
http://live.gnome.org/Vala/StringSample



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]