Having trouble sending the data from emonlib via SMS.

Im using a locally made Arduino Uno clone called Gizduino and a GSM/GPRS shield SIM900D. Im using two libraries (see attachments). I wanted to convert the double value from Emonlib to char* value in order for the GSM to recognize it. I tried to send realPower data from Emonlib(OpenEnergyMonitor) via SMS. However, the sent SMS contains blank message. I still did not connect it to the circuit diagram expecting the output should be 0.00. I've also attached an image of the circuit diagram and here is the code below:

#include <EmonLib.h>
EnergyMonitor emon1; 
#include <SerialGSM.h>
#include <SoftwareSerial.h>
SerialGSM cell(2,3);
void setup(){  
 char* realPower;
 dtostrf(emon1.realPower, 5, 2, realPower);
 Serial.begin(9600); 
 cell.begin(9600);
  cell.Verbose(true);
  cell.Boot(); 
  cell.FwdSMS2Serial();
  cell.Rcpt("+639265209022");
  cell.Message(realPower);
  cell.SendSMS();
}


void loop(){
  if (cell.ReceiveSMS()){
    Serial.println(cell.Message());
    cell.DeleteAllSMS();
  }

}

EmonLib-master.zip (7.22 KB)

SerialGSM-master.zip (4.24 KB)

I wanted to convert the double value from Emonlib to char* value in order for the GSM to recognize it.

But, you changed your mind? The dtostrf() function can convert a double, or float, to a string. But, realPower is NOT a string. It is a pointer. It doesn't point to anything. It's a bit like handing a dry erase marker to someone, and saying write on the white board, without actually having a white board. You have no idea where the marker is going to write.

Use a real array, not a pointer to space that you haven't allocated.

So instead of declaring char* realPower; ... it should be declared as char realPower[1]; ? Or how should i do it? i'm still not really familiar about coding the array. Can you discuss it thoroughly?