Jump to content

Double Index On Array-of-arrays Problem.

Recommended Posts



I'm using BoostC on WinXP under MPLab IDE 8.02.


The BoostC is:

BoostC Optimizing C Compiler Version 6.84 (for PIC18 architecture)


... and I'm targeting a PIC18F4523.


I need a 1k buffer, and organising it as 8 pages of 128 bytes is effective and useful, so I've declared it as:


static unsigned char page0[128], page1[128], page2[128], page3[128], page4[128], page5[128], page6[128], page7[128];

static unsigned char *lcd_graphic_buffer[8] = { page0, page1, page2, page3, page4, page5, page6, page7 };


Now if I need to access a particular byte in the buffer, I ought to be able to do something like


lcd_graphic_buffer[1][45] = 0x00;


but this fails; I haven't looked to see where the rvalue goes, but it is not in the right place.


If, however, I do the equivalent


*(lcd_graphic_buffer[1] + 45) = 0x00;


then it works fine.


Have I got things right, or am I missing something?



Link to post
Share on other sites
  • 5 months later...
This seems a useful way of creating large arrays but the bug does not seem fixed in v6.89. Overlooked perhaps?


This problem is still outstanding even in the latest 6.90 The good news is that we started working on it and plan to have it fixed by the next release.




Link to post
Share on other sites
  • 3 weeks later...
  • 1 month later...

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...