We have investigated elastic deformations by external magnetic fields in flat samples of smectic C with fixed boundary conditions. In the calculations the internal parameters (tilt angle, density, interlayer distance) are assumed to be fixed, distortions of the smectic layers are neglected, and only reorientations of the director about the normal to the smectic layers are allowed. The problem is solved exactly assuming a one-dimensional variation of the order parameter. Stability conditions and explicit expressions for the orientation of the director as a function of position are derived for general orientations of the magnetic field. Solutions of the variational problem can be classified according to the maximum deviation angle, Φ, of the director. In general there are several separated allowed regions of Φ. When Fréedericksz transitions occur, they are usually discontinuous first-order transitions. The properties of the solutions are discussed and some special examples are considered in detail. Transitions are investigated both as a function of the magnitude and of the orientation of the magnetic field. Expressions for the free energy are also derived.