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 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
How do we print something, e.g. my name, in C language without using the printf function?
int main() { char str1; char str1; strcpy (str1,"tutorialspoint"); strcpy (str1,"compileonline"); puts(str1); puts(str1); return (0); } Compile and run the above program to produce the following result tutorialspoint compileonline
Praveen
0 0
6
any one can teach me c++
Yes of course i can give you online classes
Bhuvanesh
What are the toughest topics in C language?
Pointers and memory management
Kavidassan
0 0
6
Who created C?
The C was primarily created by Dennis Ritchie, an American computer scientist, in the early 1970s while working at Bell Labs. C was designed as a system programming language, initially for building utilities...
Srinivasan
0 0
7

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

Ask a Question

Related Lessons

Working with C/C++ applications
Inorder to learn C and C++ programming languages one can work with various editors available.To name a few are the most popular one is turbo c++, DEV C++, Eclipse, NetBeans. Here are the screen shots...

Functions In C Programming
A C-language program is nothing but collection of Function, these are the building blocks of a ‘C’ program. Generally, a function mans a task. “Function is a...

Find out the Output of the following with reason and get C Language Training fess less by 10%
1. void main() { clrscr(); printf(5+"Beautifull"); getch(); } 2. void main() { int a=50; clrscr(); ...

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...

Everything about printf in C language
What is printf and from where it comes from in C code.? You must have used printf so many times in your Car programs but do you really know everything about printf? Let's see. What is the full form...

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