Slashdot Mirror


User: rsearle

rsearle's activity in the archive.

Stories
0
Comments
5
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 5

  1. Re:Brilliant! Simply brilliant! on Longhorn Drops 'My' Prefixes · · Score: 1

    Or you could, you know, right-click the icon and choose "rename". Just like every other icon on the desktop.

  2. Re:love of the Irish. on New Windows Worm Inching Around Internet · · Score: 1
    Pretty sure it is true for all variables on a computer (ie. binary based).


    Not if you want portable code. In particular, if you try this in C, it will likely fail unpredictably. The reason for this is that the C standard allows implementations to insert "padding bits" into non-integer variables; if those padding bits have any special meaning to the system, you're screwed.


    Also, not all binary values need have a valid representation. These values are refered to as "trap values", and will often cause a program to abort.


    This has been discussed several times on comp.lang.c; here's on of them:
    "question about FAQ, swapping values".

  3. Re:The solution on Quickly Filling Up 150GB of Legal Media Files? · · Score: 1
    I've said it before, and I'll say it again:

    void main() is not and never has been standard C. Unless you're programming for a freestanding implementation (usually an embedded system), this causes undefined behaviour. (yes, I read too much comp.lang.c)

  4. Re:Here's some immortal code... on Immortal Code · · Score: 2, Funny

    Unfortunatley, void main() has never been valid ANSI/ISO C. The standard states that main() shall return an int. Also note that the latest standard (C99) requires the type specifier to be present; you can no longer rely on main() defaulting to int.

    Output is not guaranteed to be displayed until either a newline is encountered, or a call is made to fflush(). So it is perfectly possible that the user will never see anything.

    For maximum portability, it is recommended that you return EXIT_SUCCESS or EXIT_FAILURE from main(). So, here is the correct version:

    #include <stdio.h>
    #include <stdlib.h>

    int main(void)
    {
    if (printf("Hello, World!\n") < 0))
    return EXIT_FAILURE;
    else
    return EXIT_SUCCESS;
    }

  5. Re:backward compatibility costs nothing on Nintendo's Playstation Settlement Bombshell (or not...updated) · · Score: 2, Informative

    The Sega Genesis had the ability to run games from Sega's previous console the Master System. The Genesis was a 68000-based console, but it used a Z80 for sound processing. You could buy a converter that adapted your old Master System cartridges to the Genesis form and ran them on the sound processor.