2014/1/14-2/5 [Computer/SW/Languages/C_Cplusplus] UID:54763 Activity:nil | 1/14 Why is NULL defined to be "0" in C++ instead of "((void *) 0)" like in
C? I have some overloaded functtions where one takes an integer
parameter and the other a pointer parameter. When I call it with
"NULL", the compiler matches it with the integer version instead of
the pointer version which is a problem. Other funny effect is that
sizeof(NULL) is different from sizeof(myPtr). Thanks.
...
|
2012/7/19-11/7 [Computer/SW/Languages/C_Cplusplus] UID:54439 Activity:nil | 7/19 In C or C++, how do I write the code of a function with variable
number of parameters in order to pass the variable parameters to
another function that also has variable number of parameters? Thanks.
\_ The usual way (works on gcc 3.0+, Visual Studio 2005+):
#define foo(fmt, ...) printf(fmt, ##__VA_ARGS__)
The cool new way (works on gcc 4.3+):
...
|
2006/2/21-23 [Computer/SW/Languages/Java] UID:41939 Activity:nil | 2/21 What is the best way to get the current method name in Java? So far
I have seen 3 approaches:
1. Create new Exception, grab the first frame off its stack trace.
Inelegant, requires creating a stack trace (expensive).
\_ Yeah it sucks. Yeah it does much more work than you need.
Yeah it is really fragile and may break when you switch java
...
|
2006/2/1-3 [Consumer/CellPhone, Computer/SW/Security] UID:41652 Activity:low | 2/1 Dear old farts. What was the consumer end of telecomm like before
the 1983 divestiture of AT&T into 7 baby Bells, in terms of price
for consumers, sound quality, reliability, and service?
\_ Most of you youngin' were too young to remember this but back
then long distance calls were prohibitively expensive. On the
other hand, you didn't have tons of long distance carriers to
...
|
2006/1/23-25 [Computer/SW/Languages/Java] UID:41480 Activity:nil | 1/23 I'm trying to make somebody else's code thread-safe and it seems like
my synchronization blocks are not being respected. Does anyone know
a problem with this code?
class FooPoller {
protected static Boolean lock = new Boolean(true);
private static void poll() {
...
|
2012/1/18-3/3 [Computer/SW/Languages/Java, Finance/Investment] UID:54290 Activity:nil | 1/18 I own a bunch of NFLX stocks bought at several different periods
(from high $200 all the way down to $80). I dumped a few and
still have a few. Why the hell is Reid Hastings still making
$500,000/year? How do I join the pending NFLX Class Action
Lawsuit?
\_ Why would you buy stock in a company run by a narcissistic
...
|
|