answersLogoWhite

0

Yes, see the C99 ISO standard §6.5.2.1/2. Assuming a pointer "a" into an allocated array, a[-1] is equivalent to *(a - 1). Naturally, if (a - 1) points to an unallocated memory location, you get undefined behavior.

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
JudyJudy
Simplicity is my specialty.
Chat with Judy
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi

Add your answer:

Earn +20 pts
Q: C allows an array index of both positive and negative integer?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

What number goes into 750?

The following are factors of 750, meaning they go into 750 a certain number of times. To find out how many times the number goes into 750, find the corresponding number on the other side of the array. For instance to see how many times 5 goes into 750, find the 4th-last number in the array (150):1, 2, 3, 5, 6, 10, 15, 25, 30, 50, 75, 125, 150, 250, 375, 750


A magic square is a square array of positive integers such that the sum of each row column and?

I recently studied a magic square. It is a square that when each row, diagonal, horizontally, or vertically is added up, it equals the same positive integer.


What happens if a subscript value is negative or higher than the number of elements in an array?

It cannot be part of the array.


What is the default value of the array elements in an integer array?

'0' Try this: public static void main(String[] args){ } The output would be 0 even though you did not initialize any value in the int array.


Write a function in java that accepts an array of integers and returns the second largest integer in the array Return -1 if there is no second largest?

Method 1: Sort the array in descending order, compare 1st and 2nd if not same , return 2nd if same return -1 Method 2: Find the largest number in the array, initialize another array with dimension 1 less than of original. Copy the array elements from the original array minus the largest element. not select largest from the second array and compare with the previous one if not same return the second largest if same return -1