Search:

Type: Posts; User: hzcodec

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. OK, I will initialize my variables. Thank you for...

    OK, I will initialize my variables. Thank you for your help.

    Just did it, and now it's working :)
  2. Handling of callback function that is not registered

    I have a problem of how to handle registering of a callback function.

    In Example 1, I commented away reg_cb(f1); and in the function irq_handler() the check is working ok (callback = NULL).
    ...
  3. Replies
    3
    Views
    1,604

    OK, thanks for your comment.

    OK, thanks for your comment.
  4. Replies
    3
    Views
    1,604

    I actually came up with this solution. Maybe this...

    I actually came up with this solution. Maybe this is the way to do it?



    #include <stdlib.h>

    void sayHello(int a)
    {
    printf("Hello: %d\n", a);
    }
  5. Replies
    3
    Views
    1,604

    Passing a parameter via function pointer

    Hi,
    I'm trying to pass a parameter via a function pointer. My first attempt without a parameter works but when adding it, it fails.

    So this is without an in parameter to the function pointer in...
  6. Replies
    8
    Views
    1,470

    I prefer a simple if(a== b). It's just that I...

    I prefer a simple if(a== b). It's just that I found this in one of our project and got a bit puzzled.
  7. Replies
    8
    Views
    1,470

    OK, Thanks for your reply.

    OK, Thanks for your reply.
  8. Replies
    8
    Views
    1,470

    Comparing integers the short way

    I saw this in a project (simplified of course). Is that a good way to do it or should I use an if statement instead?



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

    int main()
    {
    int a = 10;
  9. Yes, It's working. Thanks for the tip.

    Yes, It's working. Thanks for the tip.
  10. Function pointer of a function pointer with an argument

    I'm trying to use a function pointer that is taking another function pointer with an argument. So f2() is the argument to the first function.

    But I'm getting an error saying "error: lvalue...
  11. Replies
    3
    Views
    712

    OK, I see. Regarding the "-W"and "-Wall" flags...

    OK, I see.

    Regarding the "-W"and "-Wall" flags you are correct. I got a warning telling me "impilicit declaration ..."

    Thanks for the clarification.
  12. Replies
    3
    Views
    712

    When to use header files?

    The #include "plot.h" in file1.c does'nt seem to make a difference.
    If I remove the line with #include plot.h it still compiles.

    I have a structure as below:


    file1.c


    #include...
  13. Aha! That whas the problem. Yes, sizeof(obj2)...

    Aha! That whas the problem.
    Yes, sizeof(obj2) gave me 8 and sizeof(*obj2) gave me 12.

    Thank you for your help.

    Now it's working.
  14. Shared memory, cannot read last element in a struct

    Hi,

    I have trouble reading the last element in a struct.
    I do get the correct value for the first two elements. In my example that is:
    a = 11 and c = H
    however I get:
    b = 0
    but I am expecting...
  15. Replies
    6
    Views
    1,046

    Aha, got it! Thank you guys.

    Aha, got it!

    Thank you guys.
  16. Replies
    6
    Views
    1,046

    Mayby because it cannot divide anymore. It...

    Mayby because it cannot divide anymore. It reaches its 'end'. I tried to exchange the '2' to '64' and I got only two iterations.
  17. Replies
    6
    Views
    1,046

    For loop - stop condition

    I found a for loop in an example that I don't understund fully.


    for (i=64; i; i/=2)
    printf("i: %d\n",i);

    Now this is dividing by 2 until it reach '1' and stops.
    But why does this stops?
  18. Linked list example with a pointer to pointer

    Hi,

    I have a piece of code that is demonstrating a linked list. What I don't understand is what's happening in the add function.

    There is a pointer to a pointer '**q'. Further down a pointer...
  19. Replies
    4
    Views
    1,464

    OK ... 'return *c' did it. I have been trying to...

    OK ... 'return *c' did it. I have been trying to much so I got it completely wrong.

    Thank you for your help.
  20. Replies
    4
    Views
    1,464

    Sorry, I don't understand how you mean. Should I...

    Sorry, I don't understand how you mean. Should I use 'struct Coordinate CallF ...'?
  21. Replies
    4
    Views
    1,464

    Returning a struct from a function call

    Hi,

    I have a problem with returning a struct that I don't understand.
    This is just a part of my code. I get an "Incompatible types ..." error when I compile the code. I have been playing around...
  22. Replies
    6
    Views
    3,319

    Oh yes! I'm familiar with the shorthands. And...

    Oh yes! I'm familiar with the shorthands. And with a little a bit of experimenting with the code I finally got it. Just confusing myself. laserlight got me thinking in the right direction. Thank you...
  23. Replies
    6
    Views
    3,319

    Well ... "v>>1" is shifting one step but what is...

    Well ... "v>>1" is shifting one step but what is the "=" sign doing in the for loop?
  24. Replies
    6
    Views
    3,319

    I have of course done this. However I still have...

    I have of course done this. However I still have problem understanding the "v>>=1".
  25. Replies
    6
    Views
    3,319

    Tricky for loop

    I found a piece of code a while ago with a for loop that I don't understand. The purpose is counting the number of bits.


    #include <stdio.h>

    int main()
    {
    unsigned int i;
    unsigned int v...
Results 1 to 25 of 28
Page 1 of 2 1 2