suppose i declare an array of size 10(a[10]) and i try to use even 11th or 12th element...that is i try to put some data...and later extract from a[10] or a[11] ..is it possible..ans with respect to both c and c++..
mayankjain05 0 Newbie Poster
Recommended Answers
Jump to PostIt sure is possible, since C/C++ offers no built-in bounds checking. The 11th and 12th elements will refer to the memory location of the array (a) + 10 and + 11 respectively. What is in those memory locations would be difficult to say, and would be implementation specific. You could …
Jump to Postalso will the answer be same even i declare the array dynamically??
That just means you don't know at compile time what size it will be, so the memory for it gets allocated during running. Once it's allocated, it's just an array like any other. There's no magic …
All 6 Replies
nmaillet 97 Posting Whiz in Training
Tumlee 42 Junior Poster in Training
mayankjain05 0 Newbie Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
Moschops 683 Practically a Master Poster Featured Poster
mayankjain05 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.