GREENVILLE, S.C.—A 12-year-old student was shot and killed Thursday by another 12-year-old student inside their South Carolina middle school, authorities said. The shooter was found hiding under a deck at a home not far from Tanglewood Middle School in Greenville about an hour after the shooting and was still armed, Greenville County Sheriff Hobart Lewis said. The boy is charged with murder, possession of a firearm at a school and possession of a weapon by someone under 18. He was taken to a juvenile prison in Columbia, Lewis said. “He was hiding. He’s a young man, probably didn’t understand the consequences of what had just happened,” the sheriff said at a news conference. “I don’t think he knew what to do, honestly, except for to leave the school.” The boys knew each other, but the sheriff said investigators are still trying to figure out what led to the shooting in …