Search posts, tags, users, and pages
Seth White
Question, in your loop. Where is ‘j’ and ‘I’ defined?
Tristan Deane
Hey friend, I'm Tristan, a software engineer and entrepreneur from Edmonton, Canada. I have a deep fascination with technology and entrepren
Hey Seth, good catch! Those are both typos stemming from muscle memory and too much caffeine 😅.
The iterators in the loops should correspond to the specific array they're working on.
So in this case, 'i' should be 'n' which corresponds to the 'name' array.
While 'j' should be 'p' which relates to the 'price' array.
So the code should look something like: name = names[n]; price = prices[p];
Thanks for bringing this up. I've updated the article with the correct names.