UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Is it valid to address one element beyond the end of an array?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

C Language Trainer

No, array is a fixed size memory allocation for variables. It is illegal to access elements beyond the allocated space.
Comments

Thank You for the question Shivani, No for an array you cannot go beyond the size of an array. Thanks, Team DishaaPro www.dishaapro.com
Comments

Computer & Maths Professor

Yes. We can refer to an element beyond array size as C follows the following formula to go to a specific element in an array- starting address of array + sizeof(datatype of array)*subscript of array used. For example, if there is an int (assuming 2 bytes storage space for int) array of size 5 starting...
read more
Yes. We can refer to an element beyond array size as C follows the following formula to go to a specific element in an array- starting address of array + sizeof(datatype of array)*subscript of array used. For example, if there is an int (assuming 2 bytes storage space for int) array of size 5 starting from address say, 100 and the user tries to access a[5], C compiler would move to 100+2*5 i.e. address 110 irrespective of the subscript number as array elements are stored continuously in memory. read less
Comments

COMPUTER GEEK

No for an array you can not go beyond the size of array as you may be entering into restricted area and may result in segmentation fault. Only C99 allows to have the size of address at runtime
Comments

C and linux Expert

It's valid to address it, but not to see what's there.
Comments

LearnHowToLearn, Expert In Programming Languages

No. It is invalid even if there won't be any compilation error. Accessing elements beyond array size is illegal memory access may cause segmentation fault runtime.
Comments

Not a great idea, you will be accessing memory which doesn't belong to you or your array, may be used by some other variable with some other meaning/view.
Comments

VKTechnology

no. outof bound array exception occurs
Comments

website and mobile application development training, digital marketing training

No
Comments

GeeksForGeeks

C language do not perform any bounds check on array during run time, so it will not give any error if you are doing so. But technically its not right to do so, because the memory location you are using or manipulating anything may contain some very sensitive information, which may other program are...
read more
C language do not perform any bounds check on array during run time, so it will not give any error if you are doing so. But technically its not right to do so, because the memory location you are using or manipulating anything may contain some very sensitive information, which may other program are using, can lead to crash the program or machine itself.. read less
Comments

View 18 more Answers

Related Questions

What is C language?

It is a general purpose high level language used to make software for operating systems (kernel programms), game development, Embedded devices etc. It avoids the complexity of writing machine code and...
Shiva
Is C#, C++, Python, or JS better for game development?
All languages good for gamjng. But you can make 3d games in c# uaing unity software and it's very very interesting to work on it.
Mohit
0 0
6
Which is the best software for working with C language?
Choosing the best software for C programming often depends on personal preference, but popular options include GCC (GNU Compiler Collection), Visual Studio, and CLion. Consider factors like your platform,...
Kiran
0 0
6
Why is the C language important?
C language is a high-level, general-purpose programming language. It provides a straightforward, consistent, powerful interface for programming systems. That's why the C language is widely used for developing...
Ganesh
0 0
5
What is an lvalue?
L-Value stands for left value L-Value of Expressions refer to a memory locations In any assignment statement L-Value of Expression must be a container(i.e. must have ability to hold the data) Variable...
Nagasanthoshi

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Why do pointers have a datatype?
Before we start with pointers you must know what is a variable and a datatype. int a; This is the basic line in every program in 'C' . It means that we are asking the compiler to give us 2 bytes of space...

C++ Program-Working with constant using #define preprocessor
//Header Files #include#include // using #define preprocessor for defining a constant#define len 10#define br 5#define rad 3#define NEWLINE '\n' //Main function void main(){ int area_r; float area_c; //Function...

Tress And Its Traversal
Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1 Trees are one of the data structures like...


Bit wise operators in C
Bit Wise Operators Bit Wise operators are manipulates of individual bits with in a word of memory. The bit wise operators can be divided in to three general category. One’s Complement...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more