1. 1

    Whoever built this why did you start with a blaring trumpet? Immediately closed the window, never opening it again.

    1. 1

      Windows 3.1 (well, Windows for a long time) started with a sound played on the speaker. Modern OSes don’t do that anymore, I think.

      1. 1

        Did not notice the sound, probably would have done the same.

      1. 1

        You want indices in C starting at 1?

        #include <stdio.h>
        void main(void) {
            char a[] = {1, 2, 3};
            char *b = a-1;
            printf("%d\n", b[1]);

        I love the reason they give here for zero-based is a CEO wants to race yachts.

        1. 1

          That’s undefined behavior.

        1. 5

          The claim that C++ is a superset of C is a marketing statements from the 1990s designed to attract the many C developers to C++.

          Lots of of gory details about C/C++ differences and similarities

          1. 9

            During that period, when I found myself writing a C program, I would occasionally name a variable ‘this’ so any future C++ compile would complain.

            1. 1

              Nice, never seen that C book.

            1. 1

              Looks like a fairly complete list of examples.

              In practice, the problem I see most often is the implicit pointer cast. Implicit casts are an inherent part of C programming, so it actually shows up everywhere. However, C++ culture holds that casts are generally evil, and the language makes it difficult (while preferring C++’s flavor of OO instead). Most of these other issues you don’t often see in real code.

              Also, I find it a bit odd to phrase it as C being a subset of C++, instead of saying that C++ is a superset of C. I guess they technically mean the same thing, but saying C is (not) a subset almost implies that C came after C++.

              1. 1

                I got these from a couple sources, then someone pointed out this Wikipedia entry which looks more complete.

                Yeah, the implicit cast is part of the C philosophy that the programmer knows what they’re doing.

                I phrased it that way because that’s how I’ve been hearing the claim, C is a subset.