Search:

Type: Posts; User: Salem

Page 1 of 20 1 2 3 4

Search: Search took 0.23 seconds.

  1. Replies
    5
    Views
    270

    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;
    ...
  2. Replies
    5
    Views
    270

    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.
  3. Replies
    1
    Views
    194

    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...
  4. Replies
    8
    Views
    363

    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>
  5. Thread: Beginner

    by Salem
    Replies
    5
    Views
    365

    Sure, Visual Studio Express is also a good choice.

    Sure, Visual Studio Express is also a good choice.
  6. Replies
    3
    Views
    185

    GetCurrentThread function (processthreadsapi.h) -...

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

    by Salem
    Replies
    5
    Views
    365

    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...
  8. Replies
    1
    Views
    177

    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)
    ...
  9. Well there's your problem! Expecting...

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

    std::sort - cppreference.com
  10. 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...
  11. Post one of your better attempts, then we can...

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

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

    > *(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 /...
  14. Replies
    10
    Views
    462

    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.
  15. Replies
    3
    Views
    218

    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
  16. Replies
    12
    Views
    600

    > 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 =...
  17. 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...
  18. Replies
    12
    Views
    600

    > 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...
  19. Replies
    1
    Views
    243

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

    You'll need a for loop, say 32 iterations.
  20. Replies
    10
    Views
    491

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

    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.
  22. Replies
    12
    Views
    600

    > // Read the flexi force sensors This loop...

    > // Read the flexi force sensors
    This loop should be in another function.

    > uint8_t pressure_sensors; // number of pressure sensors
    A better name would save a comment.

    Perhaps your payload...
  23. Replies
    2
    Views
    294

    How about starting with a rectangle like this?...

    How about starting with a rectangle like this?
    ----------
    |........|
    |........|
    |........|
    ----------

    If you can manage that, you're half-way there, and have something to build on.
    ...
  24. Maybe you could post your code WITHOUT all that...

    Maybe you could post your code WITHOUT all that silly markup.
  25. Replies
    1
    Views
    209

    You can't return arrays. Nor can you print a...

    You can't return arrays.
    Nor can you print a whole array using printf.
    Nor is an array inherently aware of it's capacity.



    #include <stdio.h>

    void test_armstrong(int number, int *array,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4