Pizza.h
#ifndef Pizza_h
#define Pizza_h
class Pizza
{
private:
enum Size {S,M,L};
enum Type {R,V,C};
Size s;
Type t;
public:
Pizza ();
void setSize(Size x);
void setType(Type y);
int getSize ();
int getType();
void print ();
};
#endif
Functions which I want to pass
void Pizza::setSize (Size x)
{
Size s = x;
}
void Pizza::setType(Type y)
{
Type t = y;
}
My main
#include <iostream>
#include <fstream>
#include "Pizza.h"
using namespace std;
void main ()
{
enum Size {S,M,L};
enum Type {R,V,C};
Pizza p;
p.print();
Pizza *x = new Pizza;
x->print();
p.setSize(M);<----- ERROR
p.setType®;<----- ERROR
p.print();
}
My main
#include <iostream>
#include <fstream>
#include "Pizza.h"
using namespace std;
void main ()
{
enum Size {S,M,L};
enum Type {R,V,C};
Pizza p;
p.print();
Pizza *x = new Pizza;
x->print();
p.setSize(M);<----- ERROR
p.setTypeŽ;<----- ERROR
p.print();
}

New Topic/Question
Reply




MultiQuote





|