   Hero's Inventory Errors
  Im trying to make an inventory screen with just certain examples and I recieve these errors: Line 21. using obsolete binding at 'i'Line 27. expected primary-expression before "int"    expected ';' before 'int'    name lookup of 'i' changed for new ISO 'for' scoping    // Hero's Inventory// Demonstrates Arrays#include <iostream>#include <string>using namespace std;int main(){    const int MAX_ITEMS = 10;    string inventory[MAX_ITEMS];   int numItems = 0;   inventory[numItems++] = "sword";    inventory[numItems++] = "armor";    inventory[numItems++] = "shield";   cout << "Your items: \n";    for (int i = 0; i < numItems; ++i)   cout << inventory << endl;  cout << "\nYou trade your sword for a battle axe.";    inventory[0] = "battle axe";    cout << "\nYour items:\n";    for (int = 0; i < numItems; ++i)   cout << inventory << endl;  cout << "\nThe item name '" << inventory[0] << "' has ";    cout << inventory[0].size() << " letters in it.\n";   cout << "\nYou find a healing potion.";    if (numItems < MAX_ITEMS)  inventory[numItems++] = "healing potion";    else   cout << "You have to many items and can't carry another.";    cout << "\nYour items:\n";    for (int i = 0; i < numItems; i++)   cout << inventory << endl;    system("PAUSE");    return EXIT_SUCCESS;}
  If you go to that line number you see this line:for (int = 0; i < numItems; ++i)what's wrong with it? =)-me   ;  is there something wrong with it haha?   ;  int what equals zero? ;)   ;  For the first one, and I'm speculating here, but you're using 'i' outside of its scope. You don't have brackets around your line of code after the for loop on line 21. This is perfectly legal for one line of code, but the variable you're using has already fallen out of scope if you do that. Try putting the line inside brackets. That should extend the lifetime of the 'i' variable (if that's even what's going on).Like so:{  cout << inventory << endl;  }The second for loop is an easy fix. You forgot to put the 'i' variable in the instantiation spot. It should look like this:for (int i = 0; i < numItems; ++i)Happy Coding, - Goishin;  thanks a lot. I finally got it to work.   ;  Glad I could help! - Goishin   