This repository has been archived by the owner on Apr 1, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 305
Conversation
This file contains 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
jainaman224
changed the title
added data-structures-arrays.md
Updated data-structures-arrays.md
Jun 1, 2016
koustuvsinha
changed the title
Updated data-structures-arrays.md
Article : Data Structures & Arrays
Jun 1, 2016
koustuvsinha
changed the title
Article : Data Structures & Arrays
Article Update : Data Structures : Arrays
Jun 1, 2016
koustuvsinha
changed the title
Article Update : Data Structures : Arrays
Update : Data Structures : Arrays
Jun 1, 2016
LGTM 👍Lets 📦 |
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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line
ghost
added
the
Work Needed: Implement Suggestions
label
Jun 1, 2016
@raisedadead please check. C++ stuff 😉 |
LGTMI didn't check the code though. |
|
||
```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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Just one slight change above and this is good to go. |
This pull request was closed.
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