Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.12 seconds.

  1. Replies
    1
    Views
    57

    Yes, but it would be somewhat easier if you made...

    Yes, but it would be somewhat easier if you made use of existing material that explains them: cppreference.com entry list on Input/output manipulators
  2. Why don't you just change the parameter to be a...

    Why don't you just change the parameter to be a ProductType pointer? If you cannot do this because say, this function is intended to be passed as some kind of generic callback, then yes, casting to...
  3. Replies
    10
    Views
    242

    Ah. From what I understand though, this idea of a...

    Ah. From what I understand though, this idea of a "rounds" or "cost" or "work factor" parameter goes back to the key stretching idea applied to make using the old cryptographic hashes stronger when...
  4. Replies
    10
    Views
    242

    No, what I'm saying is that password hashing...

    No, what I'm saying is that password hashing algorithms want to be slow and make parallelisation difficult. That is, if you're aiming to provide a password hashing algorithm, the competitors will not...
  5. Replies
    10
    Views
    242

    This sounds more like a cryptographic hash...

    This sounds more like a cryptographic hash primitive rather than specifically a password hashing algorithm. The latter tends to have "slow" and "frustrate parallelisation" as additional goals.
  6. Replies
    3
    Views
    219

    You should read the other things Salem wrote, not...

    You should read the other things Salem wrote, not just the code.
  7. I see. So what exactly is the help that you need?

    I see. So what exactly is the help that you need?
  8. Try writing out the steps on paper and then...

    Try writing out the steps on paper and then "executing" your algorithm on paper.

    It looks like you might be getting confused between whether you want this to be a player versus player or player...
  9. Recall that macro substitution is a fairly simple...

    Recall that macro substitution is a fairly simple replacement mechanism. So if you have a function-style macro like this:

    #define ADD(x, y) ((x) + (y))
    and you use it like this:

    printf("%d\n,...
  10. No, that's just a function-style macro. The "if...

    No, that's just a function-style macro. The "if statement" is the #if macro, but of course it is a preprocessor directive, not an if statement.

    The NRFX_CHECK macro might be for flexibility so...
  11. Replies
    3
    Views
    169

    I would suggest that the first thing to do is to...

    I would suggest that the first thing to do is to format your code properly, especially where indentation is concerned. For example:

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    ...
  12. Replies
    2
    Views
    173

    bucket_straw2_choose does not appear in the code....

    bucket_straw2_choose does not appear in the code. Did you mean the bucket_choose function? That one is declared with a return type of int, so it returns an int. If you're confused by the static...
  13. Replies
    7
    Views
    189

    Let's see your code with the "one-by-one (by...

    Let's see your code with the "one-by-one (by iterating to it)" version.

    EDIT:
    Well, I decided to adapt and combine your code in post #3 into your code in post #1:

    #include <stdio.h>

    #define...
  14. Replies
    7
    Views
    189

    Yeah, that's exactly what I guessed. Why don't...

    Yeah, that's exactly what I guessed. Why don't you do the same thing in your code in post #1 as you did in your code in post #3?
  15. Replies
    7
    Views
    189

    What is the code that you used for this? Perhaps...

    What is the code that you used for this? Perhaps you did something different, e.g., you used XOR character by character rather than trying to use it with the entire array at once.

    Also, printing...
  16. Replies
    9
    Views
    166

    Yeah, I'm afraid that you're compiling as C++,...

    Yeah, I'm afraid that you're compiling as C++, not C. You need to figure out how to change your setup to compile as C, otherwise you'll find that you can write valid C code that turns out to be...
  17. Replies
    9
    Views
    166

    Post the smallest and simplest program that...

    Post the smallest and simplest program that demonstrates the compile error.

    Alternatively, you can rename class to mob_class. If that fixes your compile errors, then you're probably accidentally...
  18. Replies
    9
    Views
    166

    On a hunch: are you compiling with a C compiler...

    On a hunch: are you compiling with a C compiler or a C++ compiler? The .c file extension makes me think that it should default to C even if your compiler toolchain supports both C and C++, but I...
  19. Replies
    9
    Views
    166

    You have a rough idea, but not quite. First you...

    You have a rough idea, but not quite. First you need to define a struct type:

    struct mob
    {
    char name[NAME_MAXLEN + 1];
    char sex[SEX_MAXLEN + 1];
    char race[RACE_MAXLEN + 1];
    ...
  20. There's this trick for "commenting out" large...

    There's this trick for "commenting out" large swathes of code when testing something:

    #if 0
    some code...
    #endif
    This NRFX_CHECK function-style macro does the same thing. If NRFX_SAADC_ENABLED...
  21. What you're basically trying to do is to replace...

    What you're basically trying to do is to replace the user input with something generated by the computer. So, since the user input consists of a number representing a square selection, you just need...
  22. Replies
    9
    Views
    166

    Well, one way is to use a database engine so you...

    Well, one way is to use a database engine so you just enter the data, then given the event number you query the database for the exact data that you need. SQLite would be a possible option.
    ...
  23. Yes, you should. Why don't you do some debugging...

    Yes, you should. Why don't you do some debugging to be sure? Like just have two tiny headers and a source file. Conditional on the #ifdef, you define a function that prints "Hello world!". You then...
  24. Replies
    8
    Views
    319

    Informally, consider that (10^i)d = d (mod 9) for...

    Informally, consider that (10^i)d = d (mod 9) for a non-negative integer i and a decimal digit d (but of course 9 = 0 (mod 9)), where ^ denotes exponentiation and = denotes congruence.

    Now,...
  25. Replies
    6
    Views
    195

    That's right. Hence you need to look at the type...

    That's right. Hence you need to look at the type of the pointer, not just the numeric address associated with it.

    Given an array x of 10 ints, x is converted to a pointer to the int object at...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4