Some people seem to think that cake and pastry are the same when actually, they are not. When you say cake, this is normally made out of different ingredients that may usually be layered, although there are instances when they are not exactly layered, but they are usually made with similar ingredients. Most of them will be made out of flour, sugar, eggs, butter, and even oil.
There are a lot of cakes that will start to lose their shape if you would leave them at room temperature for an extended period of time. A pastry is normally something sweet that may be made out of dough and other types of fat that will have the ability to remain solid even at room temperature.