View previous topic :: View next topic |
Author |
Message |
Cenatronics
Joined: 27 Nov 2006 Posts: 13
|
Assigning two arrays |
Posted: Sat Jul 26, 2008 4:25 pm |
|
|
I have a problem about assigning two array.
Code is:
Code: | ....
#define ROOT 0
struct TypeMenu
{
int8 MenuID;
int8 SubMenu;
char MenuName[16];
};
const struct TypeMenu MenuOfMain[3]
={{1, ROOT, "Newyork" },
{2, ROOT, "London" },
{3, ROOT, "Madrid" }};
struct TypeMenu MenuDisplay[4];
....
....
for(i = 0; i < 4; i++)
{
if(MenuOfMain[i].SubMenu == STATE)
{
MenuDisplay[j] = MenuOfMain[i]; // ----> Not assign!!!!
j++;
}
}
....
.... |
I don't want to use for loop.
Anybody help me?
I use CCS 4.068 PIC16F877A
Cena |
|
|
Cenatronics
Joined: 27 Nov 2006 Posts: 13
|
|
Posted: Sun Jul 27, 2008 4:10 am |
|
|
This code working if I compile version 3.249.
I need a advise.
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 27, 2008 11:52 am |
|
|
Make that code into a short test program that is compilable and that
displays the structure data (after copying) with printf statements.
The program must be complete so that it compiles with no errors and
no edits or additional lines required. |
|
|
|