paulchenpanther
Goto Top

Warum braucht Apples XCODE in main() Inhalte damit ein Programm läuft und Windows nicht ?

Hallo zusammen,

ich hänge mich momentan noch einmal ein bisschen an C und programmiere auf meinem Macbook mittels XCODE. Auf meinem Windows Rechner sah das Programm so aus, damit es funktioniert:

#include <stdio.h>

main() {



Bei Apple muss allerdings in main() was drin stehen, damit das Programm funktioniert :

#include <stdio.h>

main(int arg, const char * argv[ ]) {



Was ist das und wofür wird es bei Windows nicht benötigt ?

Content-ID: 178242

Url: https://administrator.de/forum/warum-braucht-apples-xcode-in-main-inhalte-damit-ein-programm-laeuft-und-windows-nicht-178242.html

Ausgedruckt am: 15.04.2025 um 22:04 Uhr

Pjordorf
Pjordorf 01.01.2012 um 18:53:21 Uhr
Goto Top
Hallo,

Zitat von @PaulchenPanther:
main(int arg, const char * argv[ ]) {
Was ist das
Liess mal The C Book. Und hier wird es ebenfalls ausführlich erläutert

Gruß,
Peter
dog
dog 02.01.2012 um 00:34:50 Uhr
Goto Top
Bei Apple muss allerdings in main() was drin stehen, damit das Programm funktioniert :

Das halte ich für ein Gerücht.

#include <stdio.h>

int main ()
{

	// insert code here...
	printf("Hello, World!\n");  
    return 0;
}

...kompiliert bei mir unter Xcode 4 ohne Fehler oder Warnungen.

Wofür das gut ist hat Peter ja schon geschrieben.