Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.44 seconds; generated 35 minute(s) ago.

  1. > I don't know what it's actually, a struct or a...

    > I don't know what it's actually, a struct or a function,
    It's quite obviously a function.
  2. Replies
    1
    Views
    35

    > I'm not sure how critical this part may be. ...

    > I'm not sure how critical this part may be.
    Very - Setting up the initial hardware environment is a delicate operation, especially when that hardware can also generate interrupts.
    Not at all -...
  3. One or more of these. Using Timer Queues - Win32...

    One or more of these.
    Using Timer Queues - Win32 apps | Microsoft Docs
    Using Timers - Win32 apps | Microsoft Docs
    About Timers - Win32 apps | Microsoft Docs
    SetTimer function (winuser.h) - Win32...
  4. Thread: if...else ERROR

    by Salem
    Replies
    2
    Views
    114

    > city.lat_dir = 'INVALID!'; Use strcpy to copy...

    > city.lat_dir = 'INVALID!';
    Use strcpy to copy strings to arrays.

    strcpy(city.lat_dir,"INVALID");
  5. Replies
    14
    Views
    388

    You only need 1 bit per random number (you're...

    You only need 1 bit per random number (you're only storing a true/false).
    So the whole RAND_MAX range would only need 256MB of memory.
    But the lookup is O(1) when you're done.

    By contrast, an...
  6. Replies
    14
    Views
    388

    > 100M numbers is only 5% of the range of a...

    > 100M numbers is only 5% of the range of a 32-bit RAND_MAX.
    RAND_MAX is say 2147483647, which is 20x bigger than 100M, hence 5%

    > If I make a pre-computed sieve table, isn't that cheating?
    Only...
  7. Thread: mfc c++

    by Salem
    Replies
    3
    Views
    122

    Your picture doesn't work, and you obviously mean...

    Your picture doesn't work, and you obviously mean something else than "recover".
  8. Replies
    5
    Views
    143

    So how does this differ from std::vector or...

    So how does this differ from std::vector or std::array ?

    I see your readme has "If you wanna use type std::string it won't work , so instead use char*"
    Does that go for anything else which isn't...
  9. Thread: Pointers stuff

    by Salem
    Replies
    4
    Views
    164

    Yes, moved.

    Yes, moved.
  10. Thread: Pointers stuff

    by Salem
    Replies
    4
    Views
    164

    There are two (or 3) things wrong with your rev...

    There are two (or 3) things wrong with your rev function.
    1. Your local reverse array is too short (there is no room for a \0)
    2. Your local array goes out of scope when you return. You don't...
  11. So what's == if it's not a comparison operator?

    So what's == if it's not a comparison operator?
  12. Thread: mfc c++

    by Salem
    Replies
    3
    Views
    122

    > I have an exe file with Dlg.cpp and h files >...

    > I have an exe file with Dlg.cpp and h files
    > How can i recover visual studio
    If you're hoping to get back your original source code, that isn't going to happen.
  13. Replies
    2
    Views
    107

    No idea what you were searching for, but there's...

    No idea what you were searching for, but there's plenty to be found.

    An introduction to schedulers:Co-operative and pre-emptive scheduling ~ 8051 microcontrollers
    7 steps to writing a simple...
  14. Runaway recursion perhaps? #0 ...

    Runaway recursion perhaps?


    #0 0x000000000040077a in lcp (str=<error reading variable: Cannot access memory at address 0x7fffff7fef38>,
    l=<error reading variable: Cannot access memory at...
  15. That's not how getline works. getline(3):...

    That's not how getline works.
    getline(3): delimited string input - Linux man page

    You just keep calling it in a loop, and if there is a longer line somewhere in the input, getline will realloc as...
  16. There is only one address returned by malloc, but...

    There is only one address returned by malloc, but it is the start address of however many bytes you asked for, as given by your sizeof() expression.

    This is the same thing without the malloc.

    ...
  17. Replies
    2
    Views
    118

    L will be promoted to double for that part of the...

    L will be promoted to double for that part of the calculation, which will result in the whole right hand side being promoted to double for evaluation.
    The assignment will then truncate the whole...
  18. Replies
    16
    Views
    382

    Seems like one of those pointless exercises like...

    Seems like one of those pointless exercises like add two numbers without using +

    It seems the OP is lumbered with a tutor who thinks magic tricks is how you teach programming.
  19. Replies
    14
    Views
    388

    > for comparison reasons we were given an...

    > for comparison reasons we were given an executable file that holds an efficient code (we can't see the code).
    > we are supposed to try and make an even more efficient program.
    How do you compare...
  20. Replies
    16
    Views
    382

    > while (power--) // loops 28 times - CPU...

    > while (power--) // loops 28 times - CPU overloading - too expensive
    So initialise b once, and do one b /= 2 for each loop iteration.

    I've no idea what you're trying to prove here, except how...
  21. Replies
    14
    Views
    388

    That's a why, not a what. If you want more...

    That's a why, not a what.

    If you want more specific help, post the text of the challenge question.
  22. Replies
    16
    Views
    382

    That's no different to what you started with....

    That's no different to what you started with.
    printf("Exponent = %d\n", ((binary >> 23) & 255) - 127);
  23. Replies
    14
    Views
    388

    What are you trying to show?

    What are you trying to show?
  24. Replies
    16
    Views
    382

    Bit-fields or maths. #include ...

    Bit-fields or maths.


    #include <stdio.h>
    #include <math.h>
    int main ( ) {
    union {
    float x;
    struct {
    // assumes bit fields are arranged LSB first
  25. Replies
    14
    Views
    388

    > for (int i = 5; i

    > for (int i = 5; i <= sqrt(num); i = i + 6)
    Precalculate the square root, you're doing this every time around the loop.

    > for (int i = 0; i < run_n / NUM_THREADS; ++i)
    Not sure why you're not...
Results 1 to 25 of 495
Page 1 of 20 1 2 3 4