Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.34 seconds; generated 43 minute(s) ago.

  1. Thread: Pointers stuff

    by Salem
    Replies
    1
    Views
    32

    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...
  2. So what's == if it's not a comparison operator?

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

    by Salem
    Replies
    1
    Views
    69

    > 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.
  4. Replies
    2
    Views
    77

    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...
  5. 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...
  6. 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...
  7. 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.

    ...
  8. Replies
    2
    Views
    90

    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...
  9. Replies
    16
    Views
    308

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

    > 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...
  11. Replies
    16
    Views
    308

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

    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.
  13. Replies
    16
    Views
    308

    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);
  14. Replies
    10
    Views
    238

    What are you trying to show?

    What are you trying to show?
  15. Replies
    16
    Views
    308

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

    > 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...
  17. Replies
    3
    Views
    149

    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 |...
  18. Replies
    1
    Views
    133

    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...
  19. Replies
    26
    Views
    539

    > 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.
  20. Replies
    2
    Views
    239

    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...
  21. Replies
    26
    Views
    539

    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?
  22. 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...
  23. Replies
    26
    Views
    539

    > /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...
  24. 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;
  25. Replies
    1
    Views
    157

    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.
Results 1 to 25 of 495
Page 1 of 20 1 2 3 4