POV-Ray : Newsgroups : povray.off-topic : Liquid Physics : Re: Liquid Physics Server Time
1 Oct 2024 15:22:55 EDT (-0400)
  Re: Liquid Physics  
From: Orchid XP v8
Date: 31 Mar 2008 14:41:30
Message: <47f13e6a@news.povray.org>
>> 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.

That does indeed seem like at least *some* improvement...

(In C, almost every single time anybody touched printf(), the compiler 
would utter something about "suspicious pointer conversion". To this day 
nobody knows what that actually means... Even the tutors didn't seem to 
know.)


Post a reply to this message

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