Search:

Type: Posts; User: ridgerunnersjw

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. single for loop --- two conditions??

    How do you write the following as two nested loops?


    for (int low = 0, high = n - 1; low < high; low++, high--)
  2. Replies
    9
    Views
    820

    As erikkonstas points out ....it is accessible...

    As erikkonstas points out ....it is accessible throughout the program WITH the help of extern
  3. Replies
    9
    Views
    820

    Fair enough.....let me ask you this....is it true...

    Fair enough.....let me ask you this....is it true that in file a.c where int a =5; is defined (which is outside all functions within that file) that this variable will not be destroyed but be...
  4. Replies
    9
    Views
    820

    global variable question?

    File a.c

    int a = 5;


    file b.c

    #include <stdio.h>int main()
    {
    printf("%d", a);
  5. Replies
    7
    Views
    1,261

    Thank you all for the help!

    Thank you all for the help!
  6. Replies
    7
    Views
    1,261

    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)...
  7. Replies
    7
    Views
    1,261

    pointer struggles ???

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

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


    int A;
    int *pA = (int *)A;
  8. 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...
  9. 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...
  10. Replies
    4
    Views
    730

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

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

    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,...
  12. Replies
    4
    Views
    730

    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};
  13. Replies
    2
    Views
    665

    Perfect

    Perfect
  14. Replies
    2
    Views
    861

    Thank you! That answers my question.

    Thank you! That answers my question.
  15. Replies
    2
    Views
    861

    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. ...
  16. Replies
    2
    Views
    665

    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...
  17. 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...
  18. 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?
  19. 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...
  20. Thank you.... strcmp was just what I was looking...

    Thank you....
    strcmp was just what I was looking for
  21. 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")...
  22. Replies
    6
    Views
    1,069

    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 &&
    ...
  23. Replies
    6
    Views
    1,069

    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...
  24. Replies
    6
    Views
    1,069

    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);
  25. 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?
Results 1 to 25 of 79
Page 1 of 4 1 2 3 4