How come you can use both with sandwich? also, I wonder why the plural form is both Sandwiche and Sandwiches?
@lavi: I am a native speaker and I just can tell you that "einen Sandwich" doesn't exist. With the definite article it is "das Sandwich" and with the infinite article it is "ein Sandwich" - so definite it is female and indefinite it's male - one of the many weird things of the German language. @deadfrost: no, it is not the same. "a/an" is compareable to "ein / eine / eines" (this are the indefinite articles) but you say "Das ist ein Apfel" (This is an apple) and "Ich esse einen Apfel" (I eat an apple).
The gender that loan words adapt normally depends on their association with known german words.
p.e. it's "der Computer" because it has a, typically masculine, "-er" ending.
I only know "das Sandwich".
But I have heard both "der Hotdog" and "das Hotdog"...
And Achudars got it wrong. If it's neuter the accusative with indefinite article must also be "ein Sandwich". (if it were male, the accusative would have to be "einen Sandwich" [I hope this clears up why evali's answer is misleading, too])