The third star in Whomp’s Fortress is located on a platform sitting above the Blue Coin Block in the one corner of the course. There are three ways you can get this star, depending on what you want to do. Before doing anything, though, jump up to the shallow water and locate the Bob-Omb Buddy sitting by the cannon. Speak to it and the cannon will finally be of use, which is one of the options in grabbing this star (it will be needed for later).
You should have already unlocked the cannon, so get inside and aim towards the platform sitting below the large flagpole. You should see some pillars below the flagpole, though, which are joined with another platform. Remember to aim a little higher than your intended target, as there is some dropping while in the air. If you get it right, though, you should hit one of the pillars in the back, landing on the platform. Slide down the pole nearby and grab the Power Star.
Wall Jumping Method
The method to wall jump to the platform with this star is really easy, but it might take a few tries in order to get it right. The first thing you want to do is line Mario up right with the ledge above, then perform a Side Somersault or Double Jump before bouncing off the wall. Once you reach the ledge, the Power Star will be right there for the picking.
Jumping Down Method
This last method of obtaining this star involves jumping down from the large flagpole, as it is right above it. The only slight problem with this is that the ledge underneath the flagpole requires you to move backwards while in mid-air. You will want to jump off the ledge as close to it without grabbing the thing, then as soon as you’re past it, hold the direction towards the ledge below you and press the attack button. If done right, you should perform a mid-air kick and land on the ledge. All you have to do is slide down the pole to get the Power Star.