From the Super Mario Wiki
Retrieved from "http://www.mariowiki.com/index.php?title=%3F_Switch&oldid=2021054"
The ? Switch first appears in Super Mario 64 DS. It appears in the secret level which is also titled ? Switch, which was formerly titled Tower of the Wing Cap. It serves mainly as a one-shot replacement to the three ! Switches. Upon pressing the ? Switch, all ? Blocks in the game will become solid (and therefore, usable). Whereas the three ! Switches only fill in ! Blocks of their respective color, the ? Switch fill in all ? Blocks.
The ? Switch also appears in Yoshi's Story. When a Yoshi presses the ? Switch by simply Jumping on it, the ? Switch disappears and the part of the level in the game is changed. The ? Switch acts like a P-Switch but the main difference is that a part of the level changes. The countdown of the changed area of the level will begin as the music plays. If the music goes rapidly, the Yoshi doesn't have much time with the changed area of the level as it will turn back to normal in a short moment. There are ? Switch Panels that prevent the changed area of the level.
? Switches appear most recently in New Super Mario Bros., this time with an orange color. When hit, these switches change or add an area of a level, anything from adding moving platforms to flipping the entire level upside down. The effects of these switches can be temporary or permanent, varying from switch to switch. They also appear in New Super Mario Bros. Wii, New Super Mario Bros. 2 and New Super Mario Bros. U with the same effects as in New Super Mario Bros.
In versions of Super Mario Maker before version 1.30, P Switches in the New Super Mario Bros. U theme have the appearance of ? Switches.
Names in other languages