Device-to-device (D2D) communications provide efficient ways to increase spectrum utilization ratio with reduced power consumption for proximity wireless applications. In this paper, we investigate resource allocation strategies for D2D communications underlaying cellular networks. To be specific, we study the centralized resource allocation algorithm for controlling transmit powers of the underlying D2D pairs in order to maximize the weighted sum-rate while guaranteeing the quality of service (QoS) requirements for both D2D pairs and cellular users (CUs). A novel DC (difference of convex function) programming-based method, called alternative DC (ADC) programming, is introduced to effectively solve this complicated resource allocation problem. Through updating each D2D pair’s power alternatively, the QoS requirement for each D2D pair can be solvable and incorporated systematically to the introduced ADC programming framework. The simulation results show that the introduced ADC programming achieves the highest weighted sum-rate compared to the state-of-the-art methods while ensuring that the QoS of each D2D pair and CU are satisfied.