modifying the Serial library and I can't figure out what the error means

So I'm tired of having to change Strings to strings[] and decided to just add it into the library.
I added

void Print::write(String a)
{
  char str[a.length()];
  a.toCharArray(str,a.length());

  while (str)
line37    write(str++);
}

under public methods in the Serial.cpp file and

virtual void write(const String a);

under public: of the Serial.h file and get the error:

C:\Program Files\arduino-0022\hardware\arduino\cores\arduino\Print.cpp: In member function 'virtual void Print::write(String)':
C:\Program Files\arduino-0022\hardware\arduino\cores\arduino\Print.cpp:37: error: lvalue required as increment operand

I don't know if anyone else has done something similar but help would be greatly appreciated.
Thanks,
Strix

So I'm tired of having to change Strings to strings[] and decided to just add it into the library.

What version of the IDE are you using? 0022 already supports printing Strings.

I'm using 0022, I'm trying to add Serial.write not .print and also the line37 isn't in the code I was just labeling it.

is this an idea?

void Print::write(String a)
{
  char str[a.length()];
  a.toCharArray(str,a.length());
  write(str);     // call the char array write 
}

Wow robtillaart, literally 5 seconds before I read your post I tried it, yes it works, thank you.
It helps me to even put things out there so I see it in a different environment. XD

I'm using 0022, I'm trying to add Serial.write not .print

Why? The print() function ends up calling the write() function anyway. Why do you feel the need to shortcut that process?