CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

how do i use memcpy instruction?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
E_KARVELAs



Joined: 14 Feb 2007
Posts: 46
Location: Greece & Cyprus

View user's profile Send private message

how do i use memcpy instruction?
PostPosted: Sun Feb 18, 2007 6:17 pm     Reply with quote

hi there
is there any way i can copy THE byte of table
lets say

Code:
Code:

from DIG_2[1][6] to buffer[6]
or
from DIG_2[3][6] to buffer[6]


well did the follow
''
Code:

memcpy(buffer,DIG_2[1][6],8);
''
but have a error of:
*** Error 45 "C:\Documents and Settings\Evagoras.EVAGORASHP\Desktop\mplab_C_TO_hex\matrix.c" Line 135(23,24): Subscript out of range

any help????
Code:

int8 buffer[6];


const int8 DIG_2[26][6] = {
0x7e,0x88,0x88,0x88,0x7e,0x00, // A
0xfe,0x92,0x92,0x92,0x6c,0x00, // B
0x7c,0x82,0x82,0x82,0x44,0x00, // C
0xfe,0x82,0x82,0x44,0x38,0x00, // D
0xfe,0x92,0x92,0x92,0x82,0x00, // E
0xfe,0x90,0x90,0x90,0x80,0x00, // F
0x7c,0x82,0x92,0x92,0x5e,0x00, // G
0xfe,0x10,0x10,0x10,0xfe,0x00, // H
0x00,0x82,0xfe,0x82,0x00,0x00, // I
0x04,0x02,0x82,0xfc,0x80,0x00, // J
0xfe,0x10,0x28,0x44,0x82,0x00, // K
0xfe,0x02,0x02,0x02,0x02,0x00, // L
0xfe,0x40,0x30,0x40,0xfe,0x00, // M
0xfe,0x20,0x10,0x08,0xfe,0x00, // N
0x7c,0x82,0x82,0x82,0x7c,0x00, // O
0xfe,0x90,0x90,0x90,0x60,0x00, // P
0x7c,0x82,0x8a,0x84,0x7a,0x00, // Q
0xfe,0x90,0x98,0x94,0x62,0x00, // R
0x62,0x92,0x92,0x92,0x8c,0x00, // S
0x80,0x80,0xfe,0x80,0x80,0x00, // T
0xfc,0x02,0x02,0x02,0xfc,0x00, // U
0xf8,0x04,0x02,0x04,0xf8,0x00, // V
0xfc,0x02,0x1c,0x02,0xfc,0x00, // W
0xc6,0x28,0x10,0x28,0xc6,0x00, // X
0xe0,0x10,0x0e,0x10,0xe0,0x00, // Y
0x86,0x8b,0x92,0xa2,0xc2,0x00,}; // Z




_________________
---- GREECE ----
vsmguy



Joined: 13 Jan 2007
Posts: 91

View user's profile Send private message Visit poster's website

PostPosted: Sun Feb 18, 2007 8:48 pm     Reply with quote

Looks like you are trying to copy a single element using memcpy ?

Would not an assignment work ?

And if you are trying to copy a row of elements, maybe you should try :

Code:
memcpy(buffer,DIG_2[1], 6);


?
E_KARVELAs



Joined: 14 Feb 2007
Posts: 46
Location: Greece & Cyprus

View user's profile Send private message

PostPosted: Sun Feb 18, 2007 9:36 pm     Reply with quote

Embarassed u have right!
well Shocked
Code:

memcpy(buffer,DIG_2[1], 6);
copy all 6 element of DIG_2 row1

_________________
---- GREECE ----
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group