I was browsing through some code written by another programmers code, to try and learn from it. I eventually ran into this code:
inline const FLOAT minx() const { return p1.x <? p2.x; }
inline const FLOAT maxx() const { return p1.x >? p2.x; }
This code didn't compile, and I was able to make it work by changing the code to this:
inline const FLOAT minx() const { return p1.x < p2.x ? p1.x : p2.x; }
inline const FLOAT minx() const { return p1.x > p2.x ? p1.x : p2.x; }
By doing so I can already assume what the code is supposed to do. But searching around I haven't found any other examples that implement it this way. Was this just bad code, that doesn't even compile, or does this actually work on certain compilers (and how?).
Thank you.
In this program, we need to print the duplicate elements present in the array. This can be done through two loops. The first loop will select an element and the second loop will iteration through the array by comparing the selected element with other elements.
To count total duplicate elements in given array we need two loops. Run an outer loop loop from 0 to size . Loop structure must look like for(i=0; i<size; i++) . This loop is used to select each element of array and check next subsequent elements for duplicates elements using another nested loop.
They are not part of standard C++, but GCC extensions.
From Deprecated Features:
The G++ minimum and maximum operators (
<?
and>?
) and their compound forms (<?=
) and>?=
) have been deprecated and are now removed from G++. Code using these operators should be modified to usestd::min
andstd::max
instead.
Note that they are, as the title says, deprecated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With