Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

Update : Data Structures : Arrays #1074

Merged
3 commits merged into from
Jun 2, 2016

Conversation

jainaman224
Copy link
Contributor

@jainaman224 jainaman224 changed the title added data-structures-arrays.md Updated data-structures-arrays.md Jun 1, 2016
@koustuvsinha koustuvsinha self-assigned this Jun 1, 2016
@koustuvsinha koustuvsinha changed the title Updated data-structures-arrays.md Article : Data Structures & Arrays Jun 1, 2016
@koustuvsinha koustuvsinha changed the title Article : Data Structures & Arrays Article Update : Data Structures : Arrays Jun 1, 2016
@koustuvsinha koustuvsinha added the QA label Jun 1, 2016
@koustuvsinha koustuvsinha changed the title Article Update : Data Structures : Arrays Update : Data Structures : Arrays Jun 1, 2016
@koustuvsinha
Copy link
Member

LGTM 👍

Lets 📦 :shipit:

@koustuvsinha koustuvsinha assigned alayek and ghost Jun 1, 2016
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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this line

@alayek
Copy link
Member

alayek commented Jun 2, 2016

@raisedadead please check. C++ stuff 😉

@Rafase282
Copy link
Member

LGTM

I 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.
Copy link
Member

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.

@raisedadead
Copy link
Member

Just one slight change above and this is good to go.
Merge when addressed.

@ghost ghost merged commit 318a6f5 into freeCodeCamp:master Jun 2, 2016
@BerkeleyTrue BerkeleyTrue removed the QA label Jun 2, 2016
@jainaman224 jainaman224 deleted the data-structures-arrays branch June 2, 2016 14:33
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants