Problem with variables (float) when using Twitter Library

I have been working with this Twitter Library modified for using it with the WiFi Shield to see if I could do a project with it.
Using the sketch provided I would like it to tweet a sensor reading every X minutes but after modifying the given sketch to publish a value (float) instead of a 'char' string like: "Hello World!" I receive some errors related to the change of variables (char & float).
Checking the code inside the library I think I´ve found the problem, it assigns to msg (The message to publish) a 'char' value and after having modified and saved it it still gives me an error.
I would like to know what is wrong with this sketch, thank for your help.
P.S. This is the sample sketch I used (modified), the unmodified one is in the given link up there.

#include <SPI.h> // needed in Arduino 0019 or later
#include <WiFi.h>
#include <Twitter.h>


char ssid[] = "Network Name";
char pass[] = "Secret Password"; 

// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("Your Token Here!");

float temp = 21;
// Message to post
float msg[] = temp;

void setup()
{
  delay(1000);
  WiFi.begin(ssid, pass);
  // or you can use DHCP for automatic IP address configuration.
  // WiFi.begin(mac);
  delay(10000);
  Serial.begin(9600);

  Serial.println("connecting ...");
  if (twitter.post(msg)) {
    // Specify &Serial to output received response to Serial.
    // If no output is required, you can just omit the argument, e.g.
    // int status = twitter.wait();
    int status = twitter.wait(&Serial);
    if (status == 200) {
      Serial.println("OK.");
    } else {
      Serial.print("failed : code ");
      Serial.println(status);
    }
  } else {
    Serial.println("connection failed.");
  }
}

void loop()
{
}

THE ERROR GIVEN IS: error: initializer fails to determine size of 'msg'
EDIT: ``I´ve been reding on forums that I have to convert the 'float' numbers into a string

float temp = 21;
// Message to post
float msg[] = temp;

You're taking a single float variable and trying to assign it to an array of unknown size, expecting the compiler to know how big you want the array to be.

You still need to send Twitter::post a string (array of chars). If you want to convert a float into an array of chars, you can use dtostrf()

I read that, but I do not exactly know how does dtostfr() works. Please, could you post an example?

Have you tried Google?

Of course, I am still not able to know how it exactly works. Thanks

javierdemartin:
Of course, I am still not able to know how it exactly works. Thanks

So what, from Google, have you tried? What is still confusing about it?

Very first hit
http://forum.arduino.cc/index.php?topic=103935.0

I repeat, I have never used that, I do not how how to get it to work if I need an extra library because after reading all the info you posted and I searched I am still not able to understand its use. Thanks.

javierdemartin:
I repeat, I have never used that, I do not how how to get it to work if I need an extra library because after reading all the info you posted and I searched I am still not able to understand its use. Thanks.

So if you can't understand it, ask clarifying questions. When you only ask the "how do I do this?" and "can you give me an example?", you're not going to learn much.

I would like to tweet DHT22 (Temp&Humidity) sensor readings so this would be a Weather Station but the main problem I have is that the Twitter library only can tweet char strings or *char (this prompted me in the error console) so I do not know how to fix that, I mean, I don´t know how to convert a float (the sensor reading) to a char string so the Twitter library is able to use the sensor readings.

Thanks again.

What have you tried in the hour and a half since dtostrf was first suggested?

dtostrf() isn´t recognized as a command in my IDE

javierdemartin:
dtostrf() isn´t recognized as a command in my IDE

What does that mean? Are you getting an error message when you try to compile? Or does this mysterious IDE just not autofill it for you?

It doesn´t light up like for example void() or analogRead()

dtostrf() isn´t recognized as a command in my IDE

I can't see your code.
I can't see your IDE.
I can't see your error message.

I compiled (IDE 1.0) a simple sketch using dtostrf and a well-known irrational number.
Here is the error message I got Binary sketch size: 3614 bytes (of a 14336 byte maximum) And here's the output

3.14159270

Please, post the code and the libraries you added so maybe I can identify my problem.

I didn't add any libraries.
Try it.

void setup ()
{
  float pi = M_PI;
  char buffer [10];
  // You write this line. Be sure to involve "dtostrf", "buffer" and "pi"
  Serial.begin (9600);
  Serial.println (buffer);
}

void loop ()
{
}

Using dtostrf(temp,7,2,14); it says

DHT_TWITTER:6: error: expected constructor, destructor, or type conversion before '(' token
DHT_TWITTER:24: error: expected constructor, destructor, or type conversion before 'char'
DHT_TWITTER.ino: In function 'void setup()':
DHT_TWITTER:35: error: 'msg' was not declared in this scope

Nope, still can't see your code.

#include <SPI.h> // needed in Arduino 0019 or later
#include <WiFi.h>
#include <Twitter.h>



char ssid[] = "WIFISSID";
char pass[] = "WIFIPASSWD"; 

// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("TOKENHERE");


float temp =3.14;

dtostrf(temp,7,2,14);


// Message to post
char msg[] = temp ;

void setup() {
  delay(1000);
  WiFi.begin(ssid, pass);
  // or you can use DHCP for automatic IP address configuration.
  // WiFi.begin(mac);
  delay(10000);
  Serial.begin(9600);
  
  Serial.println("connecting ...");
  if (twitter.post(msg)) {
    // Specify &Serial to output received response to Serial.
    // If no output is required, you can just omit the argument, e.g.
    // int status = twitter.wait();
    int status = twitter.wait(&Serial);
    if (status == 200) {
      Serial.println("OK.");
    } else {
      Serial.print("failed : code ");
      Serial.println(status);
    }
  } else {
    Serial.println("connection failed.");
  }
}

void loop()
{
}