Your compiler should be giving you warnings:
Code:
/*
main.c||In function 'main':|
main.c|33|warning: left-hand operand of comma expression has no effect|
main.c|33|warning: left-hand operand of comma expression has no effect|
main.c|33|warning: left-hand operand of comma expression has no effect|
main.c|33|warning: left-hand operand of comma expression has no effect|
main.c|33|warning: left-hand operand of comma expression has no effect|
||=== Build finished: 0 errors, 5 warnings ===|
*/
That is from this line:
Code:
printf("%i ", lottozahlen[0, 1, 2, 3, 4, 5]);
I'm not sure what you're trying to accomplish there, but I can tell you that it isn't what you think.
If you're just trying to print out all values in the array, you'd need to use a loop.
Code:
for(stelle = 0; stelle <= anzahl_lottozahlen; stelle++)
for(zaehler=0; zaehler <= stelle; zaehler++)
Arrays of size 'N' run from zero to 'N'-1. You're likely exceeding the bounds of your arrays since you're using <= in your check. The more proper idiom would be to just use <.
I am having a hard time following the loop logic due to the unfamiliar variable names. I suspect the value of "check" mostly/always comes out to be zero at the end of the inner "for()" loop, and only then is the condition checked at the "while()".
I'd recommend carefully reconsidering your logic, perhaps with the help of a flow chart, to help make code that is more concise and easier to follow.