Sign up to connect with N1GHTS and gain access to their complete profile
  • Member Avatar
    N1GHTS

    Replied To a Post in Program to update environment variable list.

    Setting global environment variables are OS specific, and are essentially managed by the OS itself. The OS is responsible for passing on the default environment values to new process spaces. …
  • Member Avatar
    N1GHTS

    Marked Solved Status for Is C binary flag atomic?

    Say I have code like this... typedef struct { unsigned A:1; unsigned B:1; } FlagStruct; extern FlagStruct *Flags; Imagine that the Flags instance is a shared resource in a multi-threaded …
  • Member Avatar
    N1GHTS

    Replied To a Post in Is C binary flag atomic?

    I didn't make any assumptions. I was always avoiding using flags in the way I described but decided today to ask what you guys thought about it purely out of …
  • Member Avatar
    N1GHTS

    Replied To a Post in Is C binary flag atomic?

    Thats what I thought too which is why I've been naturally avoiding using them in that way, but it would have been so convinient and elegant if it did. Thus …
  • Member Avatar
    N1GHTS

    Replied To a Post in Linux, console, ASCII box drawing characters

    You may be suprised how heavily used console interfaces are used in these modern times. I work with them and build them on a near daily basis in Linux for …
  • Member Avatar
    N1GHTS

    Created Is C binary flag atomic?

    Say I have code like this... typedef struct { unsigned A:1; unsigned B:1; } FlagStruct; extern FlagStruct *Flags; Imagine that the Flags instance is a shared resource in a multi-threaded …
  • Member Avatar
    N1GHTS

    Replied To a Post in Nested loop in turbo C

    I looked up the word "plz" in the dictionary and it does not exist, especially not one with that many letter "Z"s. Note that the question in this thread has …
  • Member Avatar
    N1GHTS

    Replied To a Post in Pointer Operation Went Wrong !!!

    Just a quick word of advice. It is more efficient to use fwrite() or fputc() instead of fprintf() for writing characters to a file one at a time. This is …
  • Member Avatar
    N1GHTS

    Replied To a Post in system() function

    Try this: int Status = system("cmd.exe /c c:/xyz.bat"); Or on Windows 64 bit: int Status = system("%windir%\\Sysnative\\cmd.exe /c c:/xyz.bat"); I'm not on Windows so I can't test this for you. …
  • Member Avatar
    N1GHTS

    Replied To a Post in system() function

    Note that system() returns a program status code. It is good practice to use this value for error handling.
  • Member Avatar
    N1GHTS

    Replied To a Post in Array name as Pointer variable.

    I believe Labdabeta answered the first question well. As for your second question you can technically do this... const *p = (const *)0x05; // Constant pointer address char *a = …
  • Member Avatar
    N1GHTS

    Replied To a Post in Pointer Increment Problem.

    I just tested the code and it agrees with Ancient Dragon's explanation. Sorry about that.
  • Member Avatar
    N1GHTS

    Replied To a Post in Pointer Increment Problem.

    Integer has nothing to do with pointer size. The pointer is the size of the memory address as dictated by the Operating System based on the CPU's capabilities. A 32 …
  • Member Avatar
    N1GHTS

    Replied To a Post in Post Increment Problem.

    Its funny to think that c=(--a)+(--a); is not any more efficient than --a;--a;c=a+a; in terms of how it compiles. Its just that the first version is ambiguous in design as …
  • Member Avatar
    N1GHTS

    Replied To a Post in import a data table with spaces and export one column

    I'd start over from scratch with this strategy: 1. Load the entire file into an array of strings. Create a new line for every newline character found. Don't bother with …
  • Member Avatar
    N1GHTS

    Replied To a Post in implementing history command

    I'm curious if your shell is merely echoing commands to another shell. What does this shell do with the commands it receives? Are they translated into a system API or …
  • Member Avatar
    N1GHTS

    Replied To a Post in converting an array of letter to an array of numbers

    These instructions assume you want to read it to memory and that the letters are being converted into numbers of equal size (1 byte): 1. Open the file for reading …
  • Member Avatar
    N1GHTS

    Replied To a Post in GCC Flags

    This is a great resource: http://gcc.gnu.org/onlinedocs/
  • Member Avatar
    N1GHTS

    Replied To a Post in volume water pseduo code

    Pseudo code, Flow charts, etc are nothing more than a human legible medium to stage the logic so that it can then be translated into code. For instance you can …
  • Member Avatar
    N1GHTS

    Replied To a Post in graphics program in c flickers only when run

    I will disagree with Acient Dragon on this one. DOSBox runs native DOS games pretty well, so you have to ask youself "what am I doing differently than these other …
  • Member Avatar
    N1GHTS

    Replied To a Post in Is this a typedef problem?

    I would classify your question a platform specific issue since again the definition of SOCKET is not your responsability. As the programmer of the PIC32 and user of your compiler …
  • Member Avatar
    N1GHTS

    Replied To a Post in Is this a typedef problem?

    This is illegal unless you are working on an embedded system or a very low tech system that only works with 1 byte addresses: typedef BYTE SOCKET; And unless you …

The End.