If your cat has dandruff along with black specks in his fur, you're dealing with two separate problems requiring two separate solutions. The dandruff results from dry skin, but the black specks indicate your cat has fleas. Because fleas can carry tapeworms and certain diseases, take your pet to the vet for an examination and deworming.
You might not think your cat has fleas because you don't see him scratching or notice any tiny insects on him. Fleas move quickly, and their eggs are too small to see with the naked eye. Those pepper-like black specks, referred to as flea dirt, are actually flea feces. Since fleas consume blood, you can check whether those specks are flea dirt or ordinary dirt by wetting a paper towel and rubbing the specks off. If the paper towel has red stains indicating blood, it's flea dirt.
Your first step to get rid of fleas is use of a monthly topical or oral flea preventive. Some products are available over the counter, but always consult your vet before administering or applying a flea preventive. Treat every cat and dog in your household. These preventives don't just kill adult fleas, but also eradicate larvae. Since fleas lay eggs on carpets and on upholstery, vacuum your house regularly if you've had a flea infestation. Either throw out the bag after every vacuuming session or put mothballs in it. A severe infestation might require hiring a pest control company.
Purchase a dandruff shampoo designed for cats, and give your flaky feline a good bath. If you're not up to the task of bathing Kitty, take him to a groomer. Unless your cat is used to baths, that's probably a better option. You don't want to end up with skin problems of your own from cat scratches. Whether or not you take on the task of bathing your cat, you can buy special oils for cats available for quick spritzes. Massage them into his fur to moisturize.
The best way to prevent dandruff is from the inside out. Feed your cat a high-quality food, and ask your vet about giving him a fatty acid supplement for skin and coat improvement. Brush him regularly. He'll probably enjoy this grooming time, and brushing does more than keep him spruce. It also provides a gentle massage and spreads oils throughout the coat.