|
-
Feb 13th, 2001, 11:14 PM
#1
Thread Starter
New Member
Why the data of the array is erased?
strcut rgbtriple
{
unsigned char red;
unsigned char green;
unsigned char blue;
};
struct rgbquad
{
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char reserved;
};
rgbtriple rgb[256];
rgbquad pallete[256];
// other code here
for (int nCount = 0; nCount < 256; nCount++)
{
pallete[nCount].red = rgb[nCount].red;
pallete[nCount].green = rgb[nCount].green;
pallete[nCount].blue = rgb[nCount].blue;
pallete[nCount].red = 0;
}
when nCount becomes 1 then all data in rgb is erased.
Can anybody help me.
Thx...
-
Feb 14th, 2001, 09:32 AM
#2
Monday Morning Lunatic
Code:
pallete[nCount].red = rgb[nCount].red;
pallete[nCount].green = rgb[nCount].green;
pallete[nCount].blue = rgb[nCount].blue;
pallete[nCount].red = 0;
Shouldn't that last one be .reserved?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Feb 14th, 2001, 08:17 PM
#3
Thread Starter
New Member
Yes, I wrote it worng, but in my code file it is reserved.
-
Feb 15th, 2001, 04:09 AM
#4
Frenzied Member
I think you should know that it is spelt palette. Just because if you use DirectX or something like that you'll need to spell it right.
Apart from that, I can't see much wrong with your code. Is there any other code you haven't posted that might affect it?
Harry.
"From one thing, know ten thousand things."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|