Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.45 seconds.

  1. Replies
    1
    Views
    22

    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...
  2. 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...
  3. 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...
  4. 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.

    ...
  5. Replies
    2
    Views
    69

    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...
  6. Replies
    16
    Views
    268

    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.
  7. Replies
    10
    Views
    168

    > 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...
  8. Replies
    16
    Views
    268

    > 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...
  9. Replies
    10
    Views
    168

    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.
  10. Replies
    16
    Views
    268

    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);
  11. Replies
    10
    Views
    168

    What are you trying to show?

    What are you trying to show?
  12. Replies
    16
    Views
    268

    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
  13. Replies
    10
    Views
    168

    > 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...
  14. Replies
    3
    Views
    129

    https://faq.cprogramming.com/cgi-bin/smartfaq.cgi?...

    https://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044844545&id=1043284392

    If you want to do more than just print text (using cout), then you'll need
    Console Functions - Windows Console |...
  15. Replies
    1
    Views
    114

    Your comments document the language, not what...

    Your comments document the language, not what your program does.
    Although having said that, some tutors seem to like that kind of stuff.

    The only semi-useful comment would be the one "/* These...
  16. Replies
    26
    Views
    510

    > qsort( maps->buff, maps->size, sizeof(struct...

    > qsort( maps->buff, maps->size, sizeof(struct paw_map), paw_compare_maps );
    Your size should be the number of elements, not the number of bytes.
  17. Replies
    2
    Views
    218

    What sort of problems are you having? (we don't...

    What sort of problems are you having? (we don't know, you didn't post code).

    How far have you got?
    - open and close the file
    - read one word from the file and print it using printf
    - read all...
  18. Replies
    26
    Views
    510

    So how does that differ from all the other public...

    So how does that differ from all the other public functions in your other source files?

    Does 'nm ./lib/libpaw.so' tell you anything about what symbols are present?
  19. If you want to know what happened on a per file...

    If you want to know what happened on a per file basis, just type
    git log path/to/file
    It will tell you just those commits which affected that file.

    Similarly for some sub-directory, like the one...
  20. Replies
    26
    Views
    510

    > /usr/bin/ld: chkpaw.c:(.text+0x5d): undefined...

    > /usr/bin/ld: chkpaw.c:(.text+0x5d): undefined reference to `paw_unload_app'
    This usually means
    - you didn't implement that function.
    - you implemented it, but it's static (or hidden) for some...
  21. for (i = 1; str[i] != '\0'; ++i); Is no...

    for (i = 1; str[i] != '\0'; ++i);

    Is no different to this, having gone round the loop once.
    for (i = 0; str[i] != '\0'; ++i);

    Compare with


    int main(void) {
    unsigned i, count;
  22. Replies
    1
    Views
    151

    Install it - Git for Windows...

    Install it - Git for Windows

    Familiarise yourself with various workflow patterns
    - 5 Git Workflows & Branching Strategy to deliver better code
    - Git Workflow | Atlassian Git Tutorial

    Use it.
  23. Replies
    8
    Views
    371

    Yes, that's pretty much how it would work.

    Yes, that's pretty much how it would work.
  24. Replies
    8
    Views
    371

    You have something like this void foo_FC80 (...

    You have something like this


    void foo_FC80 ( ) {
    if ( ... ) {
    } else {
    // JMP $EE0A in the stack frame of baz()
    }
    }
    void bar() {
  25. Replies
    15
    Views
    551

    Beware that the LSB of rand() might not be all...

    Beware that the LSB of rand() might not be all that it seems.
    Question 13.18
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4