Search:

Type: Posts; User: ridgerunnersjw

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    669

    Thank you all for the help!

    Thank you all for the help!
  2. Replies
    7
    Views
    669

    This is an embedded block of code looking at a...

    This is an embedded block of code looking at a register on an STM32 processor. The following compiles without error:


    #include <stdint.h>

    #define RCC_BASE_ADDR 0x40023800U


    int main(void)...
  3. Replies
    7
    Views
    669

    pointer struggles ???

    Pointers continually elude me.....See below two 'supposedly' equivalent examples:

    int A;
    int *pA;
    pA = &A;


    int A;
    int *pA = (int *)A;
  4. Explanation on order of precedence?

    I am under the impression that the -> takes precedence over '.' Is this true? The first statement below works but looks to me like there should be parenthesis.

    Can someone tell me what each of...
  5. Best approach for tackling search??

    I am working on an embedded 16 bit platform and have an array that when empty is stuffed with 0xFF. The array depth is 50. During a configuration process this array will take on values 0x00 for...
  6. Replies
    4
    Views
    492

    Thank you....That works. I understand your...

    Thank you....That works. I understand your comment on 0xFF vs "FF".
  7. Replies
    4
    Views
    492

    Other than using a for loop I was looking for a...

    Other than using a for loop I was looking for a way to verify that permanent_Info was loaded with 0xFF. I would like the mVk =1 in the above situation and it doesn't. Actually had to move int sW,...
  8. Replies
    4
    Views
    492

    memcmp not stepping into

    Can someone tell me why the following isn't working?


    #include <string.h>

    int main(void)
    {
    int sW, mVk;
    char permanent_Info[4] = { [0 ... 3] = 0xFF};
  9. Replies
    2
    Views
    389

    Perfect

    Perfect
  10. Replies
    2
    Views
    482

    Thank you! That answers my question.

    Thank you! That answers my question.
  11. Replies
    2
    Views
    482

    question on the use of 'static'

    I have a file file.c where I define (at the beginning of the function within file.c)

    static char sensor = EMPTY_MEMORY;



    Within this file sensor gets assigned a value other than above. ...
  12. Replies
    2
    Views
    389

    confused on strncmp vs memcmp

    I have two arrays defined as char a[4], b[4]....neither will (or should not) contain a null character.

    Can someone tell me is it better to use memcmp or strncmp when comparing the two? or for that...
  13. Laserlight: What are the pitfalls of using...

    Laserlight: What are the pitfalls of using static as you alluded to this in your post?

    forget it as I just saw Salem's comments on this....

    I do believe it is safe as I immediately act on the...
  14. I think I solved it....I just declared the return...

    I think I solved it....I just declared the return variable as static within the function and now the results are retained....Is there any reason why this method can't be used?
  15. return function pointer getting crushed??

    I have a function that produces an array result. I return a pointer to that result. I am finding that the pointer / array looks as expected at a breakpoint right after the function returns but a...
  16. Thank you.... strcmp was just what I was looking...

    Thank you....
    strcmp was just what I was looking for
  17. concatenating characters not character strings?

    I have an array of characters (not a char string) and I would like to take certain elements

    example a[4] and a[13]

    and concatenate them together to use in an equality test such as ( == "JR")...
  18. Replies
    6
    Views
    563

    char test[3] = { [0 ... 2] = 0xFF}; int flag =...

    char test[3] = { [0 ... 2] = 0xFF};

    int flag = 0;

    flag = strncmp(test, 0xFF, 3);


    Yes I could do the for loop but was hoping to do it like above bcz I am placing this in a conditional &&
    ...
  19. Replies
    6
    Views
    563

    There is nothing random here...I have an actual...

    There is nothing random here...I have an actual use case where a segment in memory will initialize to 0xFF then over time the space can change....I need a conditional to check if the space is void...
  20. Replies
    6
    Views
    563

    memcmp ?

    Can someone tell me why the following is not working?


    char temp[HOW_MANY_SENSORS] = { [0 ... (HOW_MANY_SENSORS - 1)] = 0xFF};


    test = memcmp((const void *)temp, (const void *)0xFF, 1);
  21. char radioID[4]; The code I have above seems...

    char radioID[4];

    The code I have above seems to work.....why do I need to place &radio.....I'm guessing bcz memcpy is a block type copy vs copy one after the other until sizeof is reached?
  22. strange debugger results on atomic 16 bit variable

    I have unsigned int variable that throughout code is either assigned a 0 or a 1 ....that's it....I am noticing the debugger when stopped sometimes (due to code going awry ---- verified with logic...
  23. Replies
    3
    Views
    425

    moved to memcpy and all works fine....

    moved to memcpy and all works fine....
  24. Replies
    3
    Views
    425

    strcpy not working correctly?

    I have the following:


    char *mssg, junk, CRC_char[2], sensor = 0xFF, sysID[4] = {SYSTEM_ID}, \
    Send[BUFFER_SIZE] = {[0 ... BUFFER_SIZE-1] = 0xFF}, radioID[4];

    [CODE] ...
  25. Replies
    2
    Views
    424

    comparing char array

    if I have

    char a[4];
    char b[4];

    is the following legal in c:

    if (b == a)

    These are NOT character strings just character arrays
Results 1 to 25 of 75
Page 1 of 3 1 2 3