Main is usually a function. So then when is it not?

OP (Firma: RUB) #5139907
Ich finde es immer wieder interessant, auf was fuer Ideen Menschen so 
kommen :)

Main is usually a function. So then when is it not?
http://jroweboy.github.io/c/asm/2015/01/26/when-is-main-not-a-function.html
1
It began when my coworker, despite already knowing how to program,
2
was forced to take the intro level Computer Science course at my
3
university. We joked with him about how he needs to make a program
4
that works, but the grading TAs wouldn’t be able to figure out how
5
it works. So that is the requirement, to make a functioning program
6
that completes an assignment while obfuscating it such that the
7
graders think that it shouldn’t work.
8

9
[...]
Gast
Interessante Idee, aber  ... was sagt der Standard dazu?
1
The behavior is undefined in the following circumstances:
2
...
3
-A program in a hosted environment does not define a function named main using one of the specified forms (5.1.2.2.1).
4
...
Es ist also nicht nur abhängig von der konkreten CPU, es ist auch klar 
UB.
1
"I’m guessing all that will happen when my coworker turns in an assignment looking like this is they will take off points for bad coding style and say nothing else about it."
Oder es gibt 0 Punkte, weil das Program nicht funktioniert.

Antwort schreiben

Eine eigene Frage? Dieser Thread ist über 9 Jahre alt. Stell sie in einem eigenen Thread – dort lesen mehr Leute mit, und sie wird öfter und schneller beantwortet.

Neuen Thread starten

Eine Lösung, Ergänzung oder Rückmeldung zu diesem Thread? Dann antworte hier.

Formatierung
  • [c]C-Code[/c]
  • [code]Code in anderen Sprachen, ASCII-Zeichnungen[/code]
  • [math]Formel in LaTeX-Syntax[/math]
  • [[Titel]] – Link zu einem Artikel
  • Verweis auf einen anderen Beitrag: Rechtsklick auf dessen Beitrags-ID (#8078628), „Adresse kopieren“, in den Text einfügen

Mehr zur Formatierung

Längeren Sourcecode als Anhang, nicht in den Text. JPG nur für Fotos und Scans; Zeichnungen und Screenshots als PNG oder GIF. Siehe Bildformate.

Schon registriert? Anmelden

Wird nicht angezeigt. Wir schicken dir einen Link; sobald du damit bestätigst, erscheint dein Beitrag.

Mit dem Abschicken legst du einen kostenlosen Account an und erkennst die Nutzungsbedingungen und die Datenschutzerklärung an.