@ sternst, mit AVRs hat es wohl nichts zu tun, aber ich dachte, dass ihr mir vielleicht doch helfen könnt.

@_R2D2

Habe deine Empfehlung gerne angenommen. Das Programm nochmal anders geschrieben.
Vielleicht ist es ja so etwas besser.
Das Programm lässt sich bei mir compilieren, aber es speichert einfach nicht in eine Datei und ich weiß nicht warum.
Wenn es euch nicht zu blöd ist, wäre es nett, wenn mir einer einen Rat geben kannn, was ich falsch mache.
Auch wenn der Quellcode nicht so prima ist, aber ich fange ja gerade erst an zu programmieren.

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <conio.h>
#include <string.h>

int main(int argc, char *argv[])

{

int i,y=500,anzahl,groesse;
double preis=0,gesamt=0,betrag=0;
char eingabe,antwort='N';
FILE *stream;
char dateiname[67];


do
{
system("cls");
printf("\n (Z)\tGesamtpreis");
printf("\n-------------------------------------------------");
printf("\n (A)\tPommes\t\t\t1.00 Euro");
printf("\n (B)\tKroketten\t\t1.20 Euro");
printf("\n (C)\tCurrywurst\t\t2.10 Euro");
printf("\n (D)\tSchaschlik\t\t3.50 Euro");
printf("\n (E)\tSchnitzel\t\t4.00 Euro");
printf("\n (F)\tHamburger\t\t2.20 Euro");
printf("\n (G)\tCheeseburger\t\t2.50 Euro");
printf("\n (H)\tFrikadelle\t\t1.80 Euro");
printf("\n (I)\tCola Fanta Wasser\t1.00 Euro");
printf("\n (J)\tSalate\t\t\t2.00 Euro");
printf("\n (K)\tKetchup Mayonaise \t0.30 Euro");
printf("\n (L)\tExtras");



printf("\nAuswahl bitte:");


for (i=0;i<y;i++)
{
anzahl=0;
eingabe=getchar();
switch(toupper(eingabe))
{

case 'A':
do
{
printf("\nkleine (1)\tmittlere (2)\tgrosse (3)\tWahl:");
scanf("%i",&groesse);
}while(groesse!=1&&groesse!=3&&groesse!=2);
if (groesse==1)
{
preis=1;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tkl. Pommes\t%.2lf\tEuro\tWahl:",anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
}
if (groesse==2)
{
preis=1.50;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tm. Pommes\t%.2lf\tEuro\tWahl:",anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
}
if (groesse==3)
{
preis=2;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tgr. Pommes\t%.2lf\tEuro\tWahl:",anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
}
break;

case 'B':
preis=1.20;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tKroketten\t%.2lf\tEuro\tWahl:",anzah l,preis*anzahl);
gesamt=gesamt+preis*anzahl;
break;

case 'C':
preis=2.0;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tCurrywurst\t%.2lf\tEuro\tWahl:",anza hl,preis*anzahl);
gesamt=gesamt+preis*anzahl;

break;

case 'D':

preis=3.50;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tSchaschlik\t%.2lf\tEuro\tWahl:",anza hl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
break;
case 'E':
do
{
printf("\nWiener(1)\tJaeger (2)\tZigeuner (3)\tWahl:");
scanf("%i",&groesse);
}while(groesse!=1&&groesse!=3&&groesse!=2);
if (groesse==1)
{
preis=4.0;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tWienerschnitzel\t%.2lf\tEuro\tWahl:" ,anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
}
if (groesse==2)
{
preis=4.50;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tJaegerchnitzel\t%.2lf\tEuro\tWahl:", anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
}
if (groesse==3)
{
preis=4.50;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tZigeunerschnitzel\t%.2lf\tEuro\tWahl :",anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;
}


break;

case 'F':
preis=2.20;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tHamburger\t%.2lf\tEuro\tWahl:",anzah l,preis*anzahl);
gesamt=gesamt+preis*anzahl;

break;
case 'G':
preis=2.50;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tCheeseburger\t%.2lf\tEuro\tWahl:",an zahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;


break;

case 'H':
preis=1.80;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tFrikadelle\t%.2lf\tEuro\tWahl:",anza hl,preis*anzahl);
gesamt=gesamt+preis*anzahl;

break;
case 'I':
preis=1.0;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tGetraenk\t%.2lf\tEuro\tWahl:",anzahl ,preis*anzahl);
gesamt=gesamt+preis*anzahl;

break;

case 'J':
preis=2.0;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tSalat\t%.2lf\tEuro\tWahl:",anzahl,pr eis*anzahl);
gesamt=gesamt+preis*anzahl;

break;
case 'K':
preis=0.30;
printf("\nAnzahl: ");
scanf("%i",&anzahl);
printf("\n%i\tKetchup/Mayo\t%.2lf\tEuro\tWahl:",anzahl,preis*anzahl);
gesamt=gesamt+preis*anzahl;

break;

case 'L':
printf("Betrag eingeben: ");
scanf("%lf",&preis);
printf("\n\tExtras\t%.2lf\tEuro\tWahl:",preis);
gesamt=gesamt+preis;

break;
case 'Z':
i=500;
printf("\n-----------------------------------------------------------------");
printf("\nGesamtpreis\t\t%.2lf\tEuro\n",gesamt);

break;

printf("\n\t\tGesamtbetrag erfassen\n");
printf("\nSpeichern unter >");
gets (dateiname);
if ((stream = fopen(dateiname,"w")) == NULL)
{
printf("Fehler beim oeffnen!!");
exit(1);

}
fprintf(stream,"\nGesamtbetrag\t\t%.2lf\tEuro\n",g esamt);
fclose(stream);

}

}
printf("\nNeuer Kunde?\t(J) (N): ");
antwort=toupper(getch());
}while(antwort!='N');
getch();
}