Search:

Type: Posts; User: Edelweiss

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    6
    Views
    6,886

    @anduril462 THanks! yup that was my intention of...

    @anduril462 THanks! yup that was my intention of not having access to the pointer outside that for loop. My worry was that I am not sure whether the pointer declared within each loop will affect the...
  2. Replies
    6
    Views
    6,886

    for(h=0;h

    for(h=0;h<10;h++)
    {
    testStruct_t* ptyTestStruct;
    if(test_FillStruct(&ptyTestStruct)!=test_SUCCESS)
    {
    free(ptyTestStruct);
    }
    }
  3. Replies
    6
    Views
    6,886

    Pointers in a for loop

    Hi

    if i have a for loop and inside the for loop i have a pointer. the declaration, allocating of memory and freeing the pointer is done within the for loop. Will there be any problem? Am I...
  4. Replies
    4
    Views
    1,020

    oh i see i see. Thanks for the clarifications! =)

    oh i see i see. Thanks for the clarifications! =)
  5. Replies
    4
    Views
    1,020

    oh. I saw this example about char* pointers,...

    oh. I saw this example about char* pointers, hence the question about structs




    int my_new(char **obj) {
    *obj = malloc(somesize);
    }
  6. Replies
    4
    Views
    1,020

    Structs as argument

    Hi I want to pass in a struct as an argument in a function, in which this function pass the same struct to another function.




    StructExample tyExample;

    void function1(&tyExample);
  7. Replies
    6
    Views
    3,382

    lol. but if i want to use memcmp between an...

    lol. but if i want to use memcmp between an uint8_t array of size 2 and a uint16_t variable, does it still work? since its comparing the memory at the address right?
  8. Replies
    6
    Views
    3,382

    Comparing char arrays

    Hi was wondering if I am comparing 2 char arrays of the same size, can i use memcmp?

    Or is there a better way of comparing?
  9. Replies
    13
    Views
    2,333

    lol ohhh because in my implementation the size of...

    lol ohhh because in my implementation the size of b may varies according to the variable i want to store inside, hence asking about the concept behind struct hack.




    c * test = malloc( sizeof...
  10. Thread: Bit fields

    by Edelweiss
    Replies
    5
    Views
    3,508

    if its big endian, how do i go about assigning...

    if its big endian, how do i go about assigning values to it?

    just like this?




    channels.bB1 = 1
  11. Thread: Bit fields

    by Edelweiss
    Replies
    5
    Views
    3,508

    hmm. This will be passed as a byte stream and on...

    hmm. This will be passed as a byte stream and on the other side, read the byte stream as the same as above
  12. Thread: Bit fields

    by Edelweiss
    Replies
    5
    Views
    3,508

    Bit fields

    I have a bit field struct as below




    typedef struct
    {
    uint32_t bB0:1;
    uint32_t bB1:1;
    uint32_t bB2:1;
  13. Replies
    13
    Views
    2,333

    hmm okie my code goes like this c*...

    hmm okie my code goes like this




    c* pValue;
    pValue= (c*)malloc(2 + sizeof(uint8_t));
    pValue->a= 1
    uint16_t setValue= 0x1234;
    memcpy(c->b,(uint8_t*)&setValue,sizeof(setValue));
  14. Replies
    13
    Views
    2,333

    Salem, what is the sizeof *test referring to? is...

    Salem, what is the sizeof *test referring to? is it the same as sizeof(c)?
  15. Replies
    13
    Views
    2,333

    Question concerning struct hack

    Hi, I am trying to do a struct hack




    typedef struct{
    uint8_t a;
    uint8_t b[1];
    }c;
  16. Replies
    9
    Views
    3,908

    Reusing pointers

    Hi I have a situation here in which i malloc a char_t* pt and free it. If I want to reuse this pt and malloc it of another size. Will there be any risk involved?
  17. Confused about use of pointers in functions

    If I have the following example




    char_t* pbuffer;

    pbuffer = (char_t*)malloc(10);

    functionTest(pbuffer);
  18. Replies
    4
    Views
    1,333

    Using sizeof on union

    if I have the union in a struct as below




    typedef struct{
    union{
    uint8_t value;
    }u;
    }s;
  19. Replies
    2
    Views
    842

    What does the : indicate in a struct?

    typedef struct
    {
    uint8_t bB0:1;
    uint8_t bB1:1;
    uint8_t bB2:1;
    uint8_t bB3:1;
    uint8_t bB4:1;
    uint8_t bB5:1;
    uint8_t bB6:1;
    uint8_t bB7:1;
  20. Thanks!

    Thanks!
  21. lolol

    lolol
  22. oh so if we want to pass a char array into a...

    oh so if we want to pass a char array into a function, we just have to pass in the name of the array? like in your example?
  23. Passing address or pointer as argument to function

    char_t buffer[10];

    somefunction(&buffer);






    char_t* pbuffer;
  24. Replies
    5
    Views
    939

    Oh hahaha sorry for the renaming, morning blues....

    Oh hahaha sorry for the renaming, morning blues.

    But if i declare a char* and allocate memory and pass the address of that pointer to a function, what advantages does it has?

    Compared the above...
  25. Replies
    5
    Views
    939

    oh the fillupbuffer function basically looks like...

    oh the fillupbuffer function basically looks like this



    freebuffer(char** buffer)
    {
    uint16_t a= 1234;
    memcpy(*buffer,a,sizeof(uint16_t));
    }
Results 1 to 25 of 31
Page 1 of 2 1 2