Skip to content

Fix: Corrected array update example in section 6 (arr[3] = 100)#1

Open
Aashish-gif wants to merge 1 commit intosamirsinghkshatriya:mainfrom
Aashish-gif:patch-1
Open

Fix: Corrected array update example in section 6 (arr[3] = 100)#1
Aashish-gif wants to merge 1 commit intosamirsinghkshatriya:mainfrom
Aashish-gif:patch-1

Conversation

@Aashish-gif
Copy link

This PR fixes an incorrect example in the “Updating Elements” section of the notes. Previously, the code showed:

arr = 100; // Invalid array update

This was misleading because you cannot assign directly to an array.

Changes Made

Corrected the example to:

arr[3] = 100; // Update element at index 3

Updated step-by-step explanation to clarify direct access by index.

Added clear Before/After representation of the array.

This PR fixes an incorrect example in the “Updating Elements” section of the notes.
Previously, the code showed:

arr = 100;  //  Invalid array update


This was misleading because you cannot assign directly to an array.

Changes Made

Corrected the example to:

arr[3] = 100;  //  Update element at index 3


Updated step-by-step explanation to clarify direct access by index.

Added clear Before/After representation of the array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant