This repository was archived by the owner on Apr 1, 2021. It is now read-only.
Update : Data Structures : Arrays#1074
Merged
3 commits merged intofreeCodeCamp:masterfrom Jun 2, 2016
Merged
Conversation
Member
LGTM 👍Lets 📦 |
Data-Structure-Arrays.md
Outdated
| int intarray[10] = { 0 }; // Declares an array of integer of size 10 with all elements having value 0 | ||
|
|
||
| // Choose one the two declarations and then move ahead. | ||
|
|
Member
|
@raisedadead please check. C++ stuff 😉 |
Member
LGTMI didn't check the code though. |
Data-Structure-Arrays.md
Outdated
|
|
||
| ```c++ | ||
| std::cout << intarray[0] << std::endl; // Returns 1 which is element at index of the array | ||
| std::cout << intarray[11] << std::endl; // A random number is expected, while in reality this is `dangerous`, and is primary cause of crashes as it's accessing a memory location which does not exist. |
Member
There was a problem hiding this comment.
I think you mis-interpreted this comment.
This should be:
-std::cout << intarray[11] << std::endl; // A random number is expected, while in reality this is `dangerous`, and is primary cause of crashes as it's accessing a memory location which does not exist.
+std::cout << intarray[11] << std::endl; // Would give a a "Garbage" value as there is no element at index 11 of array. That memory location is beyond the range of the array.
Member
|
Just one slight change above and this is good to go. |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1044