Forums
5
Product Forums
22
General Purpose MicrocontrollersGeneral Purpose Microcontrollers
i.MX Forumsi.MX Forums
QorIQ Processing PlatformsQorIQ Processing Platforms
Identification and SecurityIdentification and Security
Power ManagementPower Management
MCX Microcontrollers
S32G
S32K
S32V
MPC5xxx
Other NXP Products
Wireless Connectivity
S12 / MagniV Microcontrollers
Powertrain and Electrification Analog Drivers
Sensors
Vybrid Processors
Digital Signal Controllers
8-bit Microcontrollers
ColdFire/68K Microcontrollers and Processors
PowerQUICC Processors
OSBDM and TBDML
S32M
Solution Forums
4
Smart Home
Power & Energy
Mobile Robotics
Motor Control
Software Forums
16
MCUXpresso Software and ToolsMCUXpresso Software and Tools
CodeWarriorCodeWarrior
MQX Software SolutionsMQX Software Solutions
Model-Based Design Toolbox (MBDT)Model-Based Design Toolbox (MBDT)
FreeMASTER
eIQ Machine Learning Software
Embedded Software and Tools Clinic
S32 SDK
S32 Design Studio
GUI Guider
Zephyr Project
Voice Technology
Application Software Packs
Secure Provisioning SDK (SPSDK)
Processor Expert Software
MCUXpresso Training Hub
Topics
8
Mobile Robotics - Drones and RoversMobile Robotics - Drones and Rovers
NXP Training ContentNXP Training Content
University ProgramsUniversity Programs
Rapid IoT
NXP Designs
SafeAssure-Community
OSS Security & Maintenance
Using Our Community
Cloud Lab Forums
2
Hardware
Cloud Lab Knowledge Base
Knowledge Bases
11
ARM Microcontrollers
3
MCX Microcontrollers Knowledge Base
K32 L Series Microcontrollers Knowledge Base
Kinetis Microcontrollers Knowledge Base
i.MX Processors
5
i.MX RT Crossover MCUs Knowledge Base
i.MX Graphics Knowledge Base
i.MX Processors Knowledge Base
i.MX Solutions Knowledge Base
i.MX 한국어 커뮤니티 Knowledge Base
Identification and Security
0
Model-Based Design Toolbox (MBDT)
0
QorIQ Processing Platforms
0
S32 Automotive Processing Platform
0
Wireless Connectivity
0
CodeWarrior
0
MCUXpresso Suite of Software and Tools
0
MQX Software Solutions
0
FRDM Training Hub
Ideas
Blogs
Forums
Knowledge Bases
NXP Tech Blog
NXP.COM
Sign In
FAQs
Language
English (US)
日本語 | Japanese
中文 | Chinese (Simplified)
Home
:
CodeWarrior
:
CodeWarrior for MCU
:
access out of range
access out of range
All community
This category
This board
Knowledge base
Users
Products
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Options
Subscribe to RSS Feed
Mark Topic as New
Mark Topic as Read
Float this Topic for Current User
Bookmark
Subscribe
Mute
Printer Friendly Page
SOLVED
Jump to solution
access out of range
Jump to solution
11-14-2008
03:24 PM
1,906 Views
electronicfan
Contributor II
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
hello,
i have a little problem:
I get an error message:
access out of range
my code:
unsigned char my_func(void)
{
.....
return(array[8]);
}
This function is outsite of main.c
Hope somebody can help me.
Solved!
Go to Solution.
Labels
(1)
Labels
Labels:
General
Tags
(1)
Tags:
cw_for_8_and_16_bit
0
Kudos
Reply
1 Solution
Jump to solution
11-16-2008
01:42 AM
842 Views
bigmac
Specialist III
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Hello electronicfan,
Assuming that you decare an array to contain eight elements,
unsigned char array[8];
The first element of the array will be
array[0]
and the last element will be
array[7].
The element
array[8]
does not exist.
Regards,
Mac
View solution in original post
0
Kudos
Reply
All forum topics
Previous Topic
Next Topic
3 Replies
Jump to solution
11-15-2008
04:08 AM
842 Views
bigmac
Specialist III
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Hello,
What size have you declared for the global array? To return the array[8] element, the array size would need to be 9, or more.
Regards,
Mac
0
Kudos
Reply
Jump to solution
11-15-2008
12:29 PM
842 Views
electronicfan
Contributor II
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
hello Mac,
i have a global array of 8 bytes and i will return all 8 bytes to my main function.
Hope you can help me.
electronicfan
0
Kudos
Reply
Jump to solution
11-16-2008
01:42 AM
843 Views
bigmac
Specialist III
Mark as New
Bookmark
Subscribe
Mute
Subscribe to RSS Feed
Permalink
Print
Report Inappropriate Content
Hello electronicfan,
Assuming that you decare an array to contain eight elements,
unsigned char array[8];
The first element of the array will be
array[0]
and the last element will be
array[7].
The element
array[8]
does not exist.
Regards,
Mac
0
Kudos
Reply
Post Reply