6,300 reputation
1132
bio website
location Manor, TX
age 49
visits member for 3 years, 9 months
seen yesterday

Professional software developer since 1990. Primary development experience is high-level application logic using C and C++ on a variety of platforms, mostly Unix or linux. Some professional experience with Java and various flavors of SQL and RDBM systems.


Sep
24
awarded  Autobiographer
Sep
19
awarded  Nice Answer
Sep
17
answered Undefined behavior, in principle
Aug
24
awarded  Nice Answer
Aug
22
answered Why does void in C mean not void?
Aug
7
answered C programming practice, passing a pointer to a function
Jul
21
comment When I test out the difference in time between shifting and multiplying in C, there is no difference. Why?
"I have been taught that shifting in binary is much more efficient than multiplying by 2^k"; we get taught a lot of things that turn out to be wrong (or at least out of date). A smartish compiler will use the same shift operation for both.
Jul
18
answered Static vs. non-static? (with non-OOP functions)
Jul
14
comment Why can't C arrays have 0 length?
@DocBrown: Read 6.7.6.2/1 and 6.7.6.2/5 again. It's only a constraint violation if the size is a constant expression.
Jul
11
revised Why can't C arrays have 0 length?
added 159 characters in body
Jul
11
comment Why can't C arrays have 0 length?
@KevinCox: it's not a constraint violation, though, so the behavior is undefined. I'll amend my answer.
Jul
11
revised Why can't C arrays have 0 length?
added 560 characters in body
Jul
11
comment Why can't C arrays have 0 length?
@DocBrown: The standard already allows for 0-length VLAs (at least, a 0-length VLA isn't a constraint violation); the "greater than 0" constraint only applies if the array size is a constant expression. I guess the question is, how is sizeof supposed to handle a 0-length array that isn't a VLA?
Jul
11
comment Why can't C arrays have 0 length?
@DocBrown: Ah. The struct hack. I've never used it personally; never worked on a problem that needed a variably-sized struct type.
Jul
11
revised Why can't C arrays have 0 length?
added 161 characters in body
Jul
11
comment Why can't C arrays have 0 length?
@DocBrown: First, I was addressing why the language standard most likely disallows them. Secondly, I would like an example of where a 0-length array makes sense, because I honestly can't think of one. The most likely implementation is to treat T a[0] as T *a, but then why not just use T *a?
Jul
11
answered Assigning strings to pointer in C Language
Jul
11
answered Why can't C arrays have 0 length?
Jul
3
answered Understanding how variable assignment works
Jul
1
comment How bad is it calling println() often than concatenating strings together and calling it once?
Given that the slowest run still outputs over 130 lines per millisecond, the person sitting in front of the console isn't going to notice the difference for one screen's worth of output. Now, if you're streaming a lot of output which is being captured (java myProg > logfile), then yeah, this can matter. But for user interaction? This is way down in the noise.