First, if you're programming in C++ then you most probably want to use a class for your data-structure rather than a struct. In C++, a struct is treated the same as a class by the compiler except for the fact that all its members are public by default. They have their uses in C++ but in all likelihood, you probably should use a class to define 'computer'
The following is the equivalent to what you've declared.
class Computer
{
public:
int ram;
int usb;
int hdd;
};
Note: In practice, you'd typically declare your member vars private and provide public accessors/modifiers (i.e. getters/setters).
Second, you need to decide what type of 'container' your program needs - e.g. array, collection. Ask yourself whether you'll only ever have two instances or whether you need to cope with many?
It looks like you've attempted to declare an array, which is fine for starting out. In practice, you'd probably look to use a container from the STL (e.g vector in this case) and your choice here affects how you will write your loop, but let's keep things simple.
Here's how you'd declare an array large enough to hold 2 entries (and populate it):
// declare an array - 2 elements long
Computer computers[2];
// create an instance and insert into the array
Computer comp1;
computers[0] = comp1;
// create another instance and insert that into the array
Computer comp2;
computers[1] = comp2;
Now, you can use your loop logic to iterate over the array.
for (int i = 0; i <= 1; i++ ) {
cout << "How much RAM?";
cin >> computers[i].ram;
cout << "How much USB ports?";
cin >> computers[i].usb;
cout << "How much HDD?";
cin >> computers[i].hdd;
}
Note the use of the square brackets to access the array.