POV-Ray : Newsgroups : povray.off-topic : Liquid Physics : Re: Liquid Physics Server Time
1 Oct 2024 09:26:53 EDT (-0400)
  Re: Liquid Physics  
From: Nicolas Alvarez
Date: 31 Mar 2008 11:13:14
Message: <47f10d9a$1@news.povray.org>
Invisible escribió:
>>> (BTW, I thought printf() was only for C, not C++?)
>>
>> Well it is for C, but anything you can do in C you can do in C++.  Not 
>> that it's a good idea though...
> 
> Ah yes, C++ is a superset of C. But I was thinking (hoping?) that in C++ 
> you have something less hellish than prinf() to play with...

You do.

C:
printf("Number is: %d\n", somenumber);

...and be careful types match between format string and arguments 
passed, and particularly that you passed *enough* arguments

C++:
cout << "Number is: " << somenumber << "\n";

...and there is no duplicated information that could get out-of-sync 
(format and arguments).

It's just you can still use the C way if you want to.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.