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

Assigning two arrays

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



Joined: 27 Nov 2006
Posts: 13

View user's profile Send private message

Assigning two arrays
PostPosted: Sat Jul 26, 2008 4:25 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jul 27, 2008 4:10 am     Reply with quote

This code working if I compile version 3.249.

I need a advise.

Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 27, 2008 11:52 am     Reply with quote

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.
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