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 the structure of a C program?
It typically consists of sections such as preprocessor directives, global variable declarations, function prototypes, the main function, and user-defined functions. A clear structure ensures logical flow,...
Snehal
0 0
5
What does the modulus operator do?
Modulus operator '%' gives the remainder of any expression. For example : r=10%3; // r is 1 , because if you divide 10 by 3 then the remainder is 1
Sumit
Can I learn C and C++ by watching videos? If it is possible, what is the best channel?
Yes!! you can learn.but the concept won't be clear up the mark,since there is no one to guide while you are doing some programs.you might have observed these things.There are no such online tutorial that...
Mohammad
0 0
5
What are the functions in C programming?
Functions in C are the basic building blocks of a C program. A function is a set of statements enclosed within curly brackets ({}) that take inputs, do the computation, and provide the resultant output....
Kiran
0 0
6

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

Ask a Question

Related Lessons

C and C++ programming with memory level debugging
Understanding C and C++ programming by using memory level debugging. Step 1: Understand the Memory map of C executable Step 2: Start memory level debugging using popular IDE Step 3: Find the memory...

Why C is a Language and not a database?
When I interviewed a candidate, I raised this question many times, but I have not got the answer correctly. To under why C is a language and not a database, it is good to understand why our communication...

C Program-String Comparison
// WAP to compare strings entered by the user //Header files #include<stdio.h>#include<conio.h>#include<string.h> //Main function void main(){ char str1; char str2; int comp; //Function...
S

How do i get best Campus / Off Campus Placement?
Companies are looking for Skilled Freshers. So build your technical skills while doing MCA / BTech / BCA / BSc (IT or CS) into below areas- 1. Strong your programming & debugging skills ...

Creating First Program Using C Language
Step 1: Install and setup Turbo C compiler on your computer. Step 2: Open Turbo C from your Desktop or Programs menu. Select “File” from menu bar and select option “New”. Step...

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