c++ - City Data Attribute -


so have been trying add population attribute city. think have keep getting error "requires type specifier declarations".

// citytest.cpp #include <iostream> #include <cstdlib> #include <cstring>  using namespace std;  class city {   char name[12];   char population [6];    public:     city( char input[] )     {       strcpy( name, input );     }      char* getname()     {       return name;     }      popn( char input[] ) <--- bit cause error     {       strcpy( population, input );     }      char* getpop()     {       return population;     } };  int main( void ) {   city acity( "cambridge" );   cout << "city is: " << acity.getname() << endl;   city pop( "300000" );   cout << "city population: " << pop.getpop() << endl;    return 0; } 

hopefully enough suggest why doing this.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -