Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.26 seconds.

  1. Replies
    1
    Views
    37

    Looks good.

    Looks good.
  2. There are a multitude of reasons why. 1. Your...

    There are a multitude of reasons why.

    1. Your program is a userland process, so all your clocks are to some extent an approximation.

    2. calling malloc may involve a very expensive trap into the...
  3. So can you post your valgrind log output? Can...

    So can you post your valgrind log output?

    Can you control the options you give to valgrind?
  4. The comma operator doesn't do what you think it...

    The comma operator doesn't do what you think it does.

    while(PW!=ps, i<3)
    is just
    while( i<3)
    which is why "No matter if the password is 'right' it will only pass through on the third attempt."...
  5. Replies
    5
    Views
    309

    Both these do the same thing, but one uses an...

    Both these do the same thing, but one uses an extra level of indirection (a star), whereas the other returns a result.


    #include <stdio.h>
    #include <stdlib.h>

    struct Node {
    int data;
    ...
  6. Replies
    5
    Views
    309

    In the same way when you pass a pointer to an...

    In the same way when you pass a pointer to an int, you want to change the int


    void foo ( int *p ) {
    *p = 42;
    }


    You might want to change the pointer in this context.
  7. Replies
    1
    Views
    206

    You want to be doing something like...

    You want to be doing something like
    strcmp(current->data,current->nextNode->data)

    Then doing a string swap using strcpy.


    As an aside, you really need to start making some functions out of...
  8. Replies
    8
    Views
    376

    Which OS are you on? It's typically ctrl-z for...

    Which OS are you on?

    It's typically ctrl-z for DOS/Windows and ctrl-d for Linux/Unix.

    When do you signal EOF?

    hello<ctrl-z>
    is not the same as
    hello
    <ctrl-z>
  9. Thread: Beginner

    by Salem
    Replies
    5
    Views
    385

    Sure, Visual Studio Express is also a good choice.

    Sure, Visual Studio Express is also a good choice.
  10. Replies
    3
    Views
    197

    GetCurrentThread function (processthreadsapi.h) -...

    GetCurrentThread function (processthreadsapi.h) - Win32 apps | Microsoft Docs
  11. Thread: Beginner

    by Salem
    Replies
    5
    Views
    385

    I'm not sure I'd recommend an IDE that's 3 years...

    I'm not sure I'd recommend an IDE that's 3 years old, costs money after a trial period, from a site with spelling mistakes, and it doesn't even come with a compiler!

    Binary releases - Code::Blocks...
  12. Replies
    1
    Views
    182

    switch / case work well when - one side of your...

    switch / case work well when
    - one side of your if expressions are constants
    - those constants are close together.

    But your if's are variable on both sides, and the range is 1 to 372 (31*12)
    ...
  13. Well there's your problem! Expecting...

    Well there's your problem!
    Expecting "performance" out of a bubble sort.

    std::sort - cppreference.com
  14. What sort of programs do you intend to write. ...

    What sort of programs do you intend to write.

    Regular user-space programs or kernel/driver hacking?
    If you're messing with the kernel at all, then a cross-compiler might be a better idea.
    You...
  15. Post one of your better attempts, then we can...

    Post one of your better attempts, then we can show you how to fix it.
  16. Replies
    10
    Views
    508

    Maybe you want this then. A simple libpng...

    Maybe you want this then.
    A simple libpng example program

    Just type "libpng example" into your favourite search engine and read a few examples.
  17. Replies
    10
    Views
    477

    > *(stringbuild + strlen(stringbuild))...

    > *(stringbuild + strlen(stringbuild)) = ch;
    > stringbuild = (char *)realloc(stringbuild, strlen(stringbuild));
    1. You don't need to cast the result of malloc / calloc /...
  18. Replies
    10
    Views
    477

    It looks like wherever you copy/pasted this code...

    It looks like wherever you copy/pasted this code from has removed a bunch of critical whitespace from your code.
  19. Replies
    3
    Views
    228

    rpath is how make finds things. At run-time,...

    rpath is how make finds things.

    At run-time, you need to study what these tell you.
    ldd(1) - Linux manual page
    ldconfig(8) - Linux manual page
  20. Replies
    12
    Views
    606

    > I must assign the whole payload to p_data,...

    > I must assign the whole payload to p_data, otherwise just the imu will be transmitted (bluetooth application)
    It's just a pointer!
    hvx_params.p_data = sampling->payload.imu;
    hvx_params.p_data =...
  21. I fail to see how a single "if" can have a...

    I fail to see how a single "if" can have a performance impact compared to "lots of code".

    Is this backed up by some actual profiling data, or just finger in the air guessing.

    > Assume loop is...
  22. Replies
    12
    Views
    606

    > hvx_params.p_data = sampling->payload; Well in...

    > hvx_params.p_data = sampling->payload;
    Well in your code, this would be an error to begin with.
    p_data is a uint8_t*, but payload is an array of int16_t

    But aside from that, you could do...
  23. Replies
    1
    Views
    247

    You'll need a for loop, say 32 iterations.

    You'll need a for loop, say 32 iterations.
  24. Replies
    10
    Views
    508

    > I don't want simple code. I want a simple...

    > I don't want simple code. I want a simple structure code with comments that describes what happened in the algorithm.
    Probably doesn't exist.

    Carefully annotated simple code for any passing...
  25. Replies
    10
    Views
    508

    PNG is not a simple format, so there isn't simple...

    PNG is not a simple format, so there isn't simple code to read it.

    If you want simple code, then BMP is the file format for you.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4