PrettyKitty's advice is very good. Absolutely, water is a very important aspect as dehydration is a common cause of constipation in cats.
The most important thing for a cat's diet when they are suffering these kind of digestive problems is for it to be grain-free. Cats don't digest grains well in their pure form - as carnevores they would normally get their grains and plant vitamins from undigested food in the stomach of a kill). And stay away from foods high in sugars.
In addition to all the above, I very much recommend a digestive enzyme supplement like prozyme. It will help her break down and digest her food
And it is a good idea to take her to the vet at this point, absolutely.
So your kitty is constipated, right? Hopefully that's what it is, just a mild case of constipation. Pumpkin is very good for kitties with constipation. You can try canned in the mean time and see how it goes. Here is the thing, canned pumpkin is used as stool softener. It often helps with upset stomach or indigestion for both cats and dogs. It is very rich in fiber and adding just one or two teaspoonfuls to your pet's food often gets the system moving in no time.
Make sure you are feeding him foods with good amounts of fiber as it is essential to keep our pets regular. And yes, take him to the vet and please get back to us with an update. I'll keep my fingers crossed. :) Constipation or blockage can be life threatening and it can lead to megacolon later on. Digestive problems are very common in cats, and most are diet related. Commercial foods tend to stress our pets' digestive system. I should know being the owner of a cat with major digestive problems.
Any kitty with hairballs may suffer from constipation. A change in diet also causes either constipation or diarrhea. That is why we should go slowly introducing the new food so as to avoid shocking their digestive system. He needs to drink plenty of water to flush. Make sure he gets that properly. Back to his diet: I recommend that you feed him Natural Balance (sold at Petco) instead of Iams or any other commercial cat food. Their claims usually do not meet our expectations, and our cats pay the price (severe or re-ocurring digestive problems). Natural Balance I trust 100%, and you can even talk about it with the vet and do some research. It is closer to what a cat would naturally eat (raw meat, chicken, fish, fiber, vitamins and minerals)
I wish you good luck, and please come back with an update on your kitti's health. I suspect this is all diet related.