Search:

Type: Posts; User: cblix

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    3,312

    float to unsigned char

    Please observe the following code:




    *(image->data + j + (i * image->width)) = (1/sqrt(2.0)) * sum;
  2. Thread: parse error?

    by cblix
    Replies
    6
    Views
    1,357

    Ok solved it... the return was meant to be 'yuv'...

    Ok solved it... the return was meant to be 'yuv' not 'YUV'

    How annoying,
  3. Replies
    5
    Views
    4,956

    Just to avoid confusion with C++ and OOP

    Just to avoid confusion with C++ and OOP
  4. Thread: parse error?

    by cblix
    Replies
    6
    Views
    1,357

    It's a typedef and a structure.

    It's a typedef and a structure.
  5. Thread: parse error?

    by cblix
    Replies
    6
    Views
    1,357

    parse error?

    What is this error?

    error: parse error before "YUV"



    YUV *QMUL_format_converter(Image* image)
    {
    size = image->width * image->height;
  6. Replies
    5
    Views
    4,956

    I missed the dereference pointer *. But still one...

    I missed the dereference pointer *. But still one error. Thanks for viewing.





    *(yuv->y + i) = (0.257) * (*image->data + (i*3)) +
    (0.504) * (*image->data + (i*3+1)) + ...
  7. Replies
    5
    Views
    4,956

    error: invalid operands to binary *

    How the heck am I getting this error?

    error: invalid operands to binary *




    *(yuv->y + i) = (0.257) * (image->data + (i*3)) +
    (0.504) * (image->data + (i*3+1)) +
    (0.098) *...
  8. Replies
    8
    Views
    4,483

    Hopefully this helps: typedef struct...

    Hopefully this helps:




    typedef struct Image {
    char magval;
    int width;
    int height;
    int maxval;
  9. Replies
    8
    Views
    4,483

    Yeah that is the point at the moment, so I can...

    Yeah that is the point at the moment, so I can later assign to the member of the structure.
  10. Replies
    8
    Views
    4,483

    > sprintf((char *)magval, "P%c", ch); My guess...

    > sprintf((char *)magval, "P%c", ch);
    My guess is, you didn't allocate any space
    >I have, magval is a member in a structure

    > (in sprintf()my compiler seems to want the cast for some reason)...
  11. Replies
    8
    Views
    4,483

    printing the contents the pointer points to

    sprintf((char *)magval, "P%c", ch);
    printf("magic no: %s\n", *magval);



    What am I doing wrong here?

    magval is declared as char *magval (in sprintf()my compiler seems to want the cast for...
  12. Replies
    3
    Views
    1,767

    Thanks. I thought that originally, but I wanted...

    Thanks. I thought that originally, but I wanted to avoid the use of a header file. Anyway it seems to work with the header approach. Just need to create a pointer variable to it now.
  13. Replies
    3
    Views
    1,767

    Perhaps my example should help: In one C file:...

    Perhaps my example should help:

    In one C file:


    const float w[128] = {....}

    Another C file:
  14. Replies
    3
    Views
    1,767

    accessing a variable from another C file

    Hi,

    I'm trying to assign an array stored in another C file to a pointer in my C program.

    I keep getting the array is undefined :rolleyes:

    What is the best way of doing this?
  15. Thread: bit manipulation

    by cblix
    Replies
    6
    Views
    1,386

    Ok thought so.

    Ok thought so.
  16. Thread: bit manipulation

    by cblix
    Replies
    6
    Views
    1,386

    Ok. Got you.

    Ok. Got you.
  17. Thread: bit manipulation

    by cblix
    Replies
    6
    Views
    1,386

    The mask clears bit 7, resulting in...

    <QUOTE>
    The mask clears bit 7, resulting in this.
    Code:
    00101001
    </QUOTE>

    Don't you mean the mask clears bit 8?
  18. Thread: bit manipulation

    by cblix
    Replies
    6
    Views
    1,386

    bit manipulation

    Hi folks,

    volatile unsigned *general_pointer;

    general_pointer += ((*(some_structure->some_pointer_member)>>8)&0x07F);


    I'm stuck on this part of a C code, what is actually being done here?...
  19. Replies
    0
    Views
    6,508

    ping pong buffering scheme

    Hi folks,

    I'm trying to understand in detail a ping pong buffering scheme (aka. double buffering) with particular reference to audio streams. I can't locate any sufficient info on the web on this...
  20. Replies
    3
    Views
    1,551

    It's part of a huge project, just wanted to be...

    It's part of a huge project, just wanted to be really sure. Anyway, I can confirm the above code is -3
  21. Replies
    3
    Views
    1,551

    negative integer?

    #define MY_SYMBOLIC_CONSTANT 4

    mystructure.member = (Int16)-(MY_SYMBOLIC_CONSTANT-1)


    Is 'mystructure.member' simply the negative integer minus three i.e. -3


    Note: 'Int16' is a typedef of...
  22. Thread: C question

    by cblix
    Replies
    7
    Views
    1,281

    Well, from the given code, the function...

    Well, from the given code, the function interpolate is expecting to return a 'float'. I don't see how the input arguments and the return type are connected. You could have a char as a parameter but...
  23. Thread: C question

    by cblix
    Replies
    7
    Views
    1,281

    I'm 'guessing' it's a float too. And your an ass...

    I'm 'guessing' it's a float too. And your an ass too...lol...sorry


    float interpolate { ... }

    float - this is the return data type of a function. Thus, a floating point number e.g. 3.212.
  24. I'm studying Computing Engineering and I studied...

    I'm studying Computing Engineering and I studied C in my first year. My advice is, is to really understand the basics. And really practice these. Buy a good starter book like 'C in 21 days' or...
  25. Replies
    3
    Views
    15,740

    Thanks for your explantion durban, that makes...

    Thanks for your explantion durban, that makes sense. I must add this is 'C Programming' and not 'C++ Programming'.
Results 1 to 25 of 29
Page 1 of 2 1 2