Editing Filesystem
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 98: | Line 98: | ||
Malloc/Calloc avoiding literal concatenation | Malloc/Calloc avoiding literal concatenation | ||
< | <source lang="cpp"> | ||
// make some zero terminated literals | // make some zero terminated literals | ||
const char* abc = "abc"; | |||
const char* onetwothree = "123"; | |||
// concat them by specifying variable | // concat them by specifying variable | ||
const char* abc_onetwothree = abc onetwothree; | const char* abc_onetwothree = abc onetwothree; | ||
printf(abc_onetwothree); //> abc123 | printf(abc_onetwothree); //> abc123 | ||
</ | </source> | ||
== Throwing It All Together == | == Throwing It All Together == | ||
Line 112: | Line 112: | ||
Example | Example | ||
< | <source lang="cpp"> | ||
#define TITLE "APPLICATION" | #define TITLE "APPLICATION" | ||
#define ROOT "ms0:/PSP/GAME/" TITLE "/" | #define ROOT "ms0:/PSP/GAME/" TITLE "/" | ||
</ | </source> | ||
Doing this method also enables placing the TITLE macro inside of the PSP_MODULE_INFO() function. If emulating a UMD, the path would be umd0:/ instead of directly from memstick (ms0:/). | Doing this method also enables placing the TITLE macro inside of the PSP_MODULE_INFO() function. If emulating a UMD, the path would be umd0:/ instead of directly from memstick (ms0:/). |