KINGx - Das inoffizielle PlayStation Forum & News Portal
Anfängerfrage zu C - Druckversion

+- KINGx - Das inoffizielle PlayStation Forum & News Portal (http://www.kingx.de/forum)
+-- Forum:    PS Vita / PSP (/forumdisplay.php?fid=1)
+--- Forum: Homebrew (/forumdisplay.php?fid=8)
+---- Forum: Development (/forumdisplay.php?fid=34)
+---- Thema: Anfängerfrage zu C (/showthread.php?tid=23616)


Anfängerfrage zu C - MyKey - 16.09.2010 17:52

also wenn ich in c ein simples hallo welt machen will gehts es XD
ABER es beendet sich nach nicht mal einer sekunde
das ist der normale code :

#include <stdio.h>
int main (void) {
printf("Hallo Welt\n");
return 0;
}

nun habe ich gelesen das wenn man ein system("PAUSE"); zwischen setzt das es sich nicht gleich beendet also habe ich das so in den code eingebaut

#include <stdio.h>
int main (void) {
printf("Hallo Welt\n");
system("pause");
return 0;
}

aber dann bekomm ich ein error woran liegt das

pls help

mfg DKM


RE: Anfängerfrage zu C - fixit98 - 16.09.2010 17:58

Code:
#include &lt;pspkernel.h&gt;
#include &lt;pspdebug.h&gt;

PSP_MODULE_INFO("Hello World", 0, 1, 1);

#define printf pspDebugScreenPrintf

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;

cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);

sceKernelSleepThreadCB();

return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;

thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid &gt;= 0) {
sceKernelStartThread(thid, 0, 0);
}

return thid;
}


int main() {
pspDebugScreenInit();
SetupCallbacks();

printf("Hello World :) in C :D \nFixit98 ");   //Text Anzeige
printf("\nHalf Byte Loader Test Eboot");





sceKernelSleepThread();

return 0;
}


sollte funken Wink


RE: Anfängerfrage zu C - m33 - 16.09.2010 17:59

Krass schwer. Sad


RE: Anfängerfrage zu C - _Kai_ - 16.09.2010 17:59

Darkkeyblademaster :
aber dann bekomm ich ein error woran liegt das


Was bekommst du denn für einen Error ?

@Fixit98, deins ist für die PSP seins ein Konsolenprogramm Wink

Achja @Threadersteller hast du die stdlib.h includiert ?


RE: Anfängerfrage zu C - fixit98 - 16.09.2010 18:03

PSP-Hilfe :


@Fixit98, deins ist für die PSP seins ein Konsolenprogramm Wink

Achso,ja !


ich dachte hier PSP/Development da kommt nur was zur PSP Big Grin


RE: Anfängerfrage zu C - MyKey - 16.09.2010 18:19

ähhhmmm includiert was heißt das

da steht als error system was not declared in this scope

edit: problem ist gelöst hae dass gemacht was @PSP-Hilfe gesagt hat (stdlib.h includiert)
damit hat sich auch geklärt was includieren heißt
thx an ALLE

mfg DKM


RE: Anfängerfrage zu C - HacKmaN - 16.09.2010 18:33

Darkkeyblademaster :
ähhhmmm includiert was heißt das


Mit #include <die_header_datei.h> um die Datei in der Compiler-Bibleotek zu suchen, oder #include "die_header_datei.h" um im Projektverzeichniss zu suchen.

Entschuldigung, aber les dir mal bitte die Anfänge des Tutorials (oder besser Buches), dass ich dir geschickt hab durch, da wird dass alles erklährt Wink
Und ein besserer Weg als der PAUSE Konsolenbefehl (der Systemabhängig ist): Öffne die Executeable mit der Kommandozeile Wink
Einfach mit dem Befehl "cd" ins Verzeichniss in dem die Datei (.exe) ist wechseln, und dann den Namen der Datei eingeben. Wenn du MSVC++ benutzt, ist diese normalerweiße unter
X:\Dokumente und Einstellungen\Dein_Name\Eigene Dateien\Visual Studio 2008\Projects\Projektname\Debug\ oder ...\Release\ (statt Debug, falls du das Projekt als Release-Version eingestellt hast).


RE: Anfängerfrage zu C - _Kai_ - 16.09.2010 18:34

Darkkeyblademaster :
ähhhmmm includiert was heißt das


Code:
#include &lt;dateiname&gt;




RE: Anfängerfrage zu C - MyKey - 16.09.2010 19:42

probleme gelöst XD
kann geclosed werden


RE: Anfängerfrage zu C - piti_rocks - 16.09.2010 19:53

ok close