|
|
View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Question regarding int16 arrays?? |
Posted: Sat Dec 23, 2006 1:32 am |
|
|
Hi,
MCU: 16F877A
Compiler: PCM 3.228
I have the following declaration
int16 nVariable[18],p[8],nReturn;
Is this OK
nVariable[p[0]]=nReturn;
Or do I have to do this
nVariable[make8(p[0],0]=nReturn;
I find that when I use the first method, the value stored in nVariable[0] array is lost, when I load nVariable[1] with some data.
The program compiles OK, the RAM is 78-91 % and does not generate any errors, is it possible that the program goes haywire in the mcu ?
thanks
arunb |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Dec 23, 2006 3:42 pm |
|
|
Both methods should work, but the second method with the make8() looks clumsy, if the array p only is to contain 8 bit data than declare it int8 instead of int16.
I couldn't reproduce your error. As a regular poster on this forum you should know a small but complete program demonstrating your problem will give you better and faster responses, until then I'm not going to spend more time into this |
|
|
|
|
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
|