How to declare A Namespace In a Class?
Mar 3, 2012 at 6:32am UTC
Hello, here is my class. How can I declare these namespaces? I have tried several things and none of them work. Thanks for any help!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include <iomanip>
using namespace std;
class ZooClass
{
public :
int compute_total_food();
int total_food_by_type(int type);
int count_animals_by_type(int type);
int hungriest_animal();
void load_animals(string filename);
using namespace san_diego;
{
void summary_food_report();
}
using namespace cincinnati;
{
void summary_food_report();
}
private :
ifstream infile;
ofstream outfile;
struct animal
{
int type;
int food;
} zoo[100];
};
Mar 3, 2012 at 7:57am UTC
Topic archived. No new replies allowed.