using direction with the camera

I’m trying to use this script: (from unity script reference) http://docs.unity3d.com/Documentation/ScriptReference/Transform.TransformDirection.html:

public class Example : MonoBehaviour {
    public Transform cam = Camera.main.transform;
    public Vector3 cameraRelativeRight = cam.TransformDirection(Vector3.right);
    void Example() {
        rigidbody.AddForce(cameraRelativeRight * 10);
    }

I just copy and paste the exact code and I immediately get this error:

Assets/Scripts/fusRoDah.cs(11,38): error CS0236: A field initializer cannot reference the nonstatic field, method, or property `fusRoDah.cam'

more details:

My main camera is a FPS camera (the one built-in unity packages)

public class Example : MonoBehaviour {
public Vector3 cameraRelativeRight;
void Start(){
cameraRelativeRight = Camera.main.transform.TransformDirection(Vector3.right);
}
void Example() {
rigidbody.AddForce(cameraRelativeRight * 10);
}