I am just beginning to learn pointers and I have a question regarding accessing the values using the address. Suppose we have an array of say 10 elements and I begin to access all the elements starting from the 10th element, and go on untill i access the 0th element... What will happen of I access the address of the cell before the 0th element? My instructor warned me about trying such a athing, however, I'm curious as to what would happen if I do so.. Anyone here tried that? Please tell me what happens.
abhishekbalaji
0
Newbie Poster
Recommended Answers
Jump to PostWhat happens is the program attempts to access the memory at that address (let's assume some array "myArray" starts at address 50). If you attempt to access the memory at 49 it is entirely possible that you will not encounter a runtime issue (aka your program won't crash), but you …
All 2 Replies
Reply to this topic
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.