xbee communication not working with class

hi,
I am building a robot and am incorporating xbees. I wrote a simple echo program to test them and it worked perfectly:

void setup()  {
  Serial.begin(9600);
  }

void loop()  {
 if(Serial.available() > 0)  {
   char x[1];
   Serial.readBytes(x, 1);
   Serial.println(x[0]);
   }
  }

but when i tried to do the same thing using a class I am writing, it didn't work:

/*******************************
 class to send and receive
 messages using an xbee. the
 send and recieve data types
 are the ones i need for this
 project. for general use, this
 should be a template class.
*******************************/

class Zigbee  {
  public:
    // constructor takes starting serial speed
    Zigbee(int speed = 9600);
    
    // send a char
    void send(char message);
    
    // receive an char
    char receive();
  };

// constructor takes starting serial speed  
Zigbee::Zigbee(int speed)  {
  Serial.begin(speed);
  }
  
// send char
void Zigbee::send(char message)  {
  Serial.println(message);
  }

// wait until an char is received and return it
char Zigbee::receive()  {
  //while(Serial.available() < 1); // wait until there is data
  char message[1];
  Serial.readBytes(message, 1); // stores first char in message
  return message[0];
  }

Zigbee Xbee(9600);

void setup()  {}

void loop()  {
  Xbee.send(42);
  delay(100);
  }

Is there something obvious I'm missing? I would really appreciate help.

Thank you!

   char x[1];

Of what use is a one element array over a scalar variable?

Is there something obvious I'm missing?

A call the the receive method.

thanks for the suggestions. i changed Zigbee::receive() and loop() but this still doesn't work:

/*******************************
 class to send and receive
 messages using an xbee. the
 send and recieve data types
 are the ones i need for this
 project. for general use, this
 should be a template class.
*******************************/

class Zigbee  {
  public:
    // constructor takes starting serial speed
    Zigbee(int speed = 9600);
    
    // send a char
    void send(char message);
    
    // receive an char
    char receive();
  };

// constructor takes starting serial speed  
Zigbee::Zigbee(int speed)  {
  Serial.begin(speed);
  }
  
// send char
void Zigbee::send(char message)  {
  Serial.println(message);
  }

// wait until an char is received and return it
char Zigbee::receive()  {
  //while(Serial.available() < 1); // wait until there is data
  char* message;
  Serial.readBytes(message, 1); // stores first char in message
  return *message;
  }

Zigbee Xbee(9600);

void setup()  {}

void loop()  {
  Xbee.send(Xbee.receive());
  }
  char* message;
  Serial.readBytes(message, 1); // stores first char in message
  return *message;

Create a pointer pointing nowhere. Write some data there. Send back that garbage.

I'm not surprised that it "didn't work" for some definition of work.

Why is message a pointer? It should not be.

Create a pointer pointing nowhere. Write some data there. Send back that garbage.

could you show me some example code?

I'm not surprised that it "didn't work" for some definition of work.

my definition of not work is that it compiles but does nothing when uploaded onto my arduino.

Why is message a pointer? It should not be.

My version(1.0.1) says that you have to pass an array or pointer to readBytes

problem solved. I turns out that it didn't work because I tried to start the Serial before arduino called init(), which is apparently where all those functions and classes are initialized. Thanks for trying to help me