Please read Nick Gammon's post at the top of this Forum on the proper way to post source code here, which includes posting all of the code. It makes it easier for us to understand what you're doing and to test the code. Without it, we are just guessing.
Looks like the documentation (http://www.arduino.cc/en/Reference/SoftwareSerial) references the Serial documentation which uses .write() only for single characters, null terminated character strings, and character arrays with a character count. This implies you should use .print() for all other data types.
As always, John is right. Also, if you take the String class version and compile it, it uses 4050 bytes. The program below does the same thing, but only uses 2640 bytes. Moral: forget about the String class and start using the str*() and mem*() family of C functions.
#include <SoftwareSerial.h>
#define rxPin 0
#define txPin 1
// set up a new serial port
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup() {
// define pin modes for tx, rx:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
// String p = "test"; // 4050 bytes
// mySerial.print(p);
char p[] = "test"; // 2640 bytes
mySerial.write(p);
}
void loop() {
// ...
}
I was doing it that way because I had no other serial device available and wanted to show the impact of using the String class and trying to stay within the framework the OP provided. It was simply an effort to show the difference. I think your comment is uncalled for and, hence, equally stupid.