Which of the following ions is more stable? Use resonance to explain your answer.
The stability of carbocation is decided by inductive effect, hyperconjugation, resonance etc.
As structure A is having a carbocation, which is primary and allylic carbocation, whereas the carbocation in structure B has secondary and allylic carbocation.
Hence, structure B is more stable.