Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.17 seconds.

  1. Replies
    1
    Views
    75

    I only joined a bit later hah

    I only joined a bit later hah
  2. Replies
    4
    Views
    320

    Where did you find this example? By now you...

    Where did you find this example? By now you should know enough to figure out from context.

    Besides figuring out from context, there's another thing you can do: write a program to test your...
  3. Replies
    4
    Views
    320

    It's the same as your last example, except that...

    It's the same as your last example, except that the return type is pointer to int.
  4. The problem is that when you read the double with...

    The problem is that when you read the double with the previous scanf call, the newline from entering the line of input remains in the input buffer, and this is then read by the scanf call with "%c"....
  5. Can't really call it a bug when the compiler...

    Can't really call it a bug when the compiler still works perfectly fine and remains standard conforming. An odd way of dealing (or just not dealing) with UB, perhaps?
  6. Replies
    20
    Views
    688

    hamster_nz was replying to Nwb, as you can see...

    hamster_nz was replying to Nwb, as you can see from the quote. You should read hamster_nz's post #12 instead.
  7. Replies
    3
    Views
    213

    That doesn't mean anything. The expression is:...

    That doesn't mean anything. The expression is: memcmp(data_in, data_out, sizeof(data_in)) == 0

    That is, it is checking that the memory represented by data_in and data_out contain equal values.

    ...
  8. Replies
    20
    Views
    688

    Salem already provided the example of reading a...

    Salem already provided the example of reading a file.

    You're right to say that if you want to store 10 integers then the size will be 10. Dynamic memory allocation comes into play when you want...
  9. Replies
    20
    Views
    698

    That's not true. It's just rarely used since it...

    That's not true. It's just rarely used since it is the default. Here's a valid example from the C standard:

    extern int max(int a, int b)
    {
    return a > b ? a : b;
    }


    You didn't actually...
  10. Replies
    6
    Views
    280

    That's an interesting claim, so I wrote this...

    That's an interesting claim, so I wrote this program to check:

    #include <stdio.h>

    #define STR1 "CORRECT"
    #define STR2 "WRONG"

    int main(void)
    {
    char ch = 'A', ch2 = 'a';
  11. Replies
    3
    Views
    305

    A quick check shows that musl has a mailing list...

    A quick check shows that musl has a mailing list and IRC channel. Those would be appropriate places to ask concerning specific implementation considerations.

    Premature optimisation is always...
  12. Replies
    3
    Views
    305

    As you may know, this is the optimisation...

    As you may know, this is the optimisation technique known as loop unrolling. As the comments imply, the idea is to minimise branching. Instead of assigning byte by byte, they want to assign many (in...
  13. Replies
    8
    Views
    881

    That's precisely why you don't have to traverse...

    That's precisely why you don't have to traverse the whole vector. Once you find an element that doesn't have an adjacent counterpart, you know for sure it is the odd element as long as the input...
  14. Replies
    8
    Views
    881

    Perhaps the issue is at the level of the...

    Perhaps the issue is at the level of the algorithm rather than the implementation. For example, perhaps it would be more efficient to sort the vector, then do a single pass to find the first number...
  15. Ok, so you fixed an error, but you're still...

    Ok, so you fixed an error, but you're still having an error now. What is your current code and the exact error message?

    Don't just say "still didn't work" without providing such an update,...
  16. What is the exact error message?

    What is the exact error message?
  17. Replies
    11
    Views
    744

    No, but the same seed must produce the same...

    No, but the same seed must produce the same pseudorandom sequence for the same implementation of the standard library. However, standard library implementations can differ, hence across different...
  18. Replies
    11
    Views
    744

    The rand function is implementation specific.

    The rand function is implementation specific.
  19. You should include MCU_Config.h and fix the...

    You should include MCU_Config.h and fix the errors. A properly written header file will not result in multiple definition errors when included, even if it is included multiple times.


    Yes, by...
  20. Replies
    8
    Views
    698

    The inline function idea might be worth a try:...

    The inline function idea might be worth a try: while inlining isn't guaranteed, if it does happen (and the code does look like a good candidate for inlining), it may be possible that the compiler...
  21. I would suggest doing a bit more error checking,...

    I would suggest doing a bit more error checking, and making sure that you free what you malloc and fclose what you fopen. For example, you might have something along the lines of:

    int...
  22. Replies
    15
    Views
    1,105

    Unfortunately for you, C doesn't work that way....

    Unfortunately for you, C doesn't work that way. There is no notion of modules as a language feature. What you will end up with is a collection of self-contained programs, each in a single source...
  23. Replies
    15
    Views
    1,105

    Sigh. Tell you what, let's go back to the start....

    Sigh. Tell you what, let's go back to the start. We might expect you to do something like this:

    main.c

    #include "hook.h"

    int main(void)
    {
    hook();
    return 0;
  24. Replies
    4
    Views
    397

    ... the sky is falling! rstanley's point in...

    ... the sky is falling!

    rstanley's point in post #4 sounds right to me, but admittedly if the list of emails is large, "format as you want" could get very tedious, and would be a good candidate...
  25. Replies
    2
    Views
    452

    I'm guessing that since this is a job rather than...

    I'm guessing that since this is a job rather than school, you already have a sufficiently strong foundational programming background to pass the interview for this internship/junior role, but the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4