Search:

Type: Posts; User: FlyingDutchMan

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    3,097

    As far as I can tell it trying to convert your...

    As far as I can tell it trying to convert your 100000000...00000s into long ints which would never work. Put .0 on the end each one and it might just work (so it inteprets it as a float instead of...
  2. Replies
    4
    Views
    15,599

    don't forget that when converting from float ot...

    don't forget that when converting from float ot int, the computer just chops off the decimal places - in effect rounding towards zero. To counter this, add 0.5 if its positive and subtract 0.5 if its...
  3. That was the bit I wanted to know. Here is a much...

    That was the bit I wanted to know. Here is a much simpler way of doing what yu want:


    void function()
    {
    int num_of_letters[26];
    int let;

    for(let=0; let<26; let++)
    ...
  4. Replies
    7
    Views
    1,284

    What your code is really checking is: ...

    What your code is really checking is:


    while(monster!=(BOOL) TRUE){
    cout<<"1-man\n";
    cout<<"2-goblin\n";
    cin>>monster;
    }
    Perhaps you should repahse that if statement...
  5. Are you initilising them in the function they're...

    Are you initilising them in the function they're being used in? With out all of the code one can never really tell whats going on.
  6. you can do that code is a much much easier way...

    you can do that code is a much much easier way than that by using an array for the letters. I suspect your problem is that you haven't initialised your variables (a, b, c, ...) to zero.
  7. Replies
    9
    Views
    11,141

    You're checking if the current place is a space,...

    You're checking if the current place is a space, and if it isn't you're setting tel_wrong2 to 1.
    Then you're checking the current is place is a digit, and if it is't you're setting tel_wrong to 1.
    ...
  8. Replies
    15
    Views
    2,344

    Even though you've allocated 8 bytes of memory to...

    Even though you've allocated 8 bytes of memory to it, it doesn't change sizeof(int) which is what you are effectively doing. The size of the allocated space is stored internally by the program (you...
  9. Thanks for that... I got the tutorial working...

    Thanks for that... I got the tutorial working perfectly. I'm using the WaitForSingleObject() in the main program loop and after the time out iit can do the client stuff, or if the server thread dies,...
  10. Replies
    11
    Views
    4,336

    it won't be checking for it as nFact is a pointer...

    it won't be checking for it as nFact is a pointer to a unknown int. You either need to be putting the factorial number in *nFact or checking that result is larger than its previous value. Checking if...
  11. Replies
    8
    Views
    1,499

    You'[ve still got a loop that you aren't using...

    You'[ve still got a loop that you aren't using (the for(j...) one).

    The other problem is that you're not actually shifting the data you're only copy the next byte in when you have a space. This is...
  12. Thanks for that. Good to know I wasn't going to...

    Thanks for that. Good to know I wasn't going to far off track.

    The sleep is so it can update itself every 5 mins or so (connect to other computers with the same setup). According the borland C...
  13. Replies
    8
    Views
    2,143

    Why he put extraneous bits in I have no idea. But...

    Why he put extraneous bits in I have no idea. But the last two lines of code first send the IPLenth in two parts - first the high byte and then the low byte (presumably its a 16bit number).
  14. Replies
    7
    Views
    1,123

    It seems scary to me that you declare an array of...

    It seems scary to me that you declare an array of students, index them with 'i' without ever setting 'i' to a number!
  15. Replies
    9
    Views
    1,206

    The answer to your first q is quite simple -...

    The answer to your first q is quite simple - you've incremented the pointer IM1 in the line IM2 = ++IM2. This should work:


    IM2=IMAGINE; //This is not a typo
    IM1=IM2++; //Nor is this

    ...
  16. Ahh it seems that I can use...

    Ahh it seems that I can use InitialiseCriticalSection(), EnterCriticalSection(), LeaveCriticalSection() and DeleteCriticalSection(). This seems to be aimed at threads of the same process as opposed...
  17. The problem is not so much locking shared data,...

    The problem is not so much locking shared data, but more to the point the serial port. I don't wont one thread coming along and interrupting another whilest its communicating on it. I would have...
  18. Replies
    8
    Views
    2,143

    That looks like assembler to me... but it has...

    That looks like assembler to me... but it has interesting bits of a higer level langauge in it - .if .else .endif etc. As far as i can tell that is propiorty code going thats meant to be run on a dsp...
  19. Race condition: getting multiple threads to cooperate

    I'm currently writing a server program that listens for incoming incoming network transport and spawns a new thread for each new connection.

    Now all these threads will be accessing a certain...
  20. Replies
    4
    Views
    8,319

    Well I don't think I'm an expert on syntax or...

    Well I don't think I'm an expert on syntax or anything, but you do have a slight error in there and have forgotten to put one of the links in.

    As far as i can tell, the input should be inserted...
Results 1 to 20 of 21