C - C++ Arrays - Array of objects

#include <iostream> 
using namespace std; 
 
class forgetcode 
{    
public:
  string str[5];
 
  void getlanguage(string a)
  {
    static int s=0;
    str[s]=a;
    s++;
  } 
 
  void putlanguage()
  {
    static int i=0;
 
    cout<<"\n"<<str[i];
    i++;
  }
};
 
 
int main() 
{ 
  forgetcode f[5];
  string s[5]={"c","c++","java","javascript","c#"};
 
  for(int i=0; i < 5; i++) 
    f[i].getlanguage(s[i]);
 
  for(int i=0; i < 5; i++) 
    f[i].putlanguage(); 
 
  return 0; 
}