i have many photos on my SD cards for my camera. recently i was at a wedding and when i went to turn on my camera to take a photo it asked me to format my card ... if i do this will i lose all my photos on m card ? why did it randomly ask me to do this when it worked fine for the beginning of the wedding?
Yes it will, the camera treats a mem card just like a hard drive in a computer formatting will wipe any info on the card. I don't know which camera you use but the buttons you have to push in a camera to format the card are a multi step thing you shouldn't be able to do it by accident. If it happens randomly I would take the camera in to get it looked at.
I dont have a scientific response to give you but that sometimes happens rather randomly... its like sometimes when you put a pen drive in your computer and it asks to format it just because lol... i think it might have to do with the operating system doing something it shouldnt when taking the drive out the last time you used it or a hardware bug, but usually when it happens i just end up formating it since it doesnt have anything important most of the times. Though i never heard of that happening to memory cards i supose its about the same, if you dont have important pictures in it just format it (Remember that everything goes Caput) but if you, do you should try to use some low level recovery system to try to get anything out of it before you format it...
PS: i think the problem here is a bit of information that the memorycards have thats kinda only there for the machines to read about what it has on it, and it might have gotten corrupted since you used it last... with a bit of luck if you put the card on another camera or a card reader maibe it can salvage some of this information and do a kind of recovery and repair that information without the need for a format =)
Also, it is a good idea to keep several cards with you, perhaps in a memory card wallet so that when you run into this in the field you can swap and figure it out later. Also, you should always xfer your images when you get home and never keep them on your mem card. I have learned that lesson the hard way too many times