Please observe the following code:
*(image->data + j + (i * image->width)) = (1/sqrt(2.0)) * sum;
Type: Posts; User: cblix
Please observe the following code:
*(image->data + j + (i * image->width)) = (1/sqrt(2.0)) * sum;
Ok solved it... the return was meant to be 'yuv' not 'YUV'
How annoying,
Just to avoid confusion with C++ and OOP
It's a typedef and a structure.
What is this error?
error: parse error before "YUV"
YUV *QMUL_format_converter(Image* image)
{
size = image->width * image->height;
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)) + ...
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) *...
Hopefully this helps:
typedef struct Image {
char magval;
int width;
int height;
int maxval;
Yeah that is the point at the moment, so I can later assign to the member of the structure.
> 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)...
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...
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.
Perhaps my example should help:
In one C file:
const float w[128] = {....}
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?
Ok thought so.
Ok. Got you.
<QUOTE>
The mask clears bit 7, resulting in this.
Code:
00101001
</QUOTE>
Don't you mean the mask clears bit 8?
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?...
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...
It's part of a huge project, just wanted to be really sure. Anyway, I can confirm the above code is -3
#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...
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...
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.
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...
Thanks for your explantion durban, that makes sense. I must add this is 'C Programming' and not 'C++ Programming'.