Seite 45 von 340 ErsteErste ... 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 95 145 ... LetzteLetzte
Zeige Ergebnis 1.321 bis 1.350 von 10174

C/C++ Programming Help Thread

This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Zitat von Raphael That's plain utter bull. malloc shouldn't be used inside inner loops of realtime-apps, yes, but even there ...

  
  1. #1321
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Raphael
    That's plain utter bull. malloc shouldn't be used inside inner loops of realtime-apps, yes, but even there it is possible to some extent. Whoever told you that, don't listen to him.
    Ok. Thank you. My format now will be
    Code:
    00517			// First line, number of artists (5 bytes)
    016			// length of the first artist (3 bytes)
    A perfect circle	// Name of the artist (#1)
    3			// Albumcount
    016			// length of the first album
    Emotive			// Name of the album (#1)
    016			// length of the second album
    Mer de noms		// Name of the album (#2)
    016			// length of the third album
    The thiteenth step	// Name of the album (#3)
    016			// length of the second artist
    Aphex Twin		// Name of the artist (#2)
    2			// albumcount
    016			// length of the first album
    Come to daddy		// Name of the album (#1)
    016			// length of the second album
    Selected ambient works	// Name of the album (#2)
    [...]			// Name of the artist (#3)
    but without the linebreaks. This way artist and album names can be of any length and nothing will be cut. I think this is the most professional solution



  2. #1322
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard using "graphics.h" in PSPGU

    hi guys. i wanted to blit a png image of a crosshair in the center of my screen, but when i do it using PSPGU, the image doesnt show. is it posible to use graphics.h with pspgu? (also, the same thing happens when i use "printTextScreen()")
    --------------------------------------------------------------------------------------

  3. #1323
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    so ur saying text and images aren't rendering? Are you switching them from offscreen buffer to onscreen buffer?

  4. #1324
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Grimfate - graphics.h/c IS GU. IF it's not showing up, either you arent translating into view of it, or not flipping the draw/display buffers.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  5. #1325
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    You also need to call initGraphics()...


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  6. #1326
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    all of you were right. i didnt call initGraphics or flipScreen. BUT, it still wont work. my current main function:

    Code:
    int main(void)
    {
    
    	scePowerSetClockFrequency(333, 333, 166);
    
    	pspDebugScreenInit();
    	SetupCallbacks();
    	initGraphics();
    	
    	dList = memalign( 16, 640 );
    	fbp0  = 0;
     
    	InitGU();
    	SetupProjection();
    	
    	// SET CAMERA ONE POSITION //
    	cameraOne.SetPos(model_x, model_y + 1, model_z, 0.0f, 1.0f, 0.5f, 0.0f, 1.0f, 0.0f);
    
    	crossHair = loadImage("crossHair.png");
     
    	while (1) 
    	{
    		DrawScene();
    		
    		blitAlphaImageToScreen(0 ,0 ,32 , 32, crossHair, 224, 120);		
    		
    		sceDisplayWaitVblankStart();
    		fbp0 = sceGuSwapBuffers();
    		flipScreen();
                  }
     
    	sceGuTerm();			
     
    
    	free( dList );
    	free( fbp0 );
    
    	return 0;
    }
    its compiles fine, but when i boot it, it just shows a blank screen. (its not crashing cause i can still exit by pressing "home".)


    now whats wrong?
    --------------------------------------------------------------------------------------

  7. #1327
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Grimfate - You cant initlaize the GU twice. Your trying to take the easy way out by taking 2 differ GU setup functions thus casuing unknown errors (?). Since your making that FPS, i highly suggest you get off graphics.h/c (unless you want to do vectoring and whatnot with it somehow :X) and stay with raw GU. First, load and texturize an Ortho view crosshair (texturize a quad movable via analog stick).

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  8. #1328
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Hi,
    what's the quickest way to read bytes/chars x-y from a char-array? Is there a better way than using a for-loop?

  9. #1329
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    dList = memalign( 16, 640 );
    Whoever brought up that code for the command list setup should get slaughtered IMO. 640 bytes is in no way enough space to store commands as soon as you do more than drawing 10 images. It's nearly as annoying as the buffer = "myfile.png"; loadImage( buffer ); crap, only that this didn't cause any problems, it just was ugly.

    its compiles fine, but when i boot it, it just shows a blank screen.
    Either your image isn't loaded correctly (wrong path/filename/anything) or anything GU specific isn't setup correctly (read further below).

    free( fbp0 );
    Remove this line. And never do that again. You cannot free VRAM memory with the free function. Also you didn't allocate fbp0 with malloc in the first place anyway, so this is double-wrong.

    Grimfate - You cant initlaize the GU twice. Your trying to take the easy way out by taking 2 differ GU setup functions thus casuing unknown errors (?).
    Wrong. You can initialize the GU as often as you want and it will not cause any unknown errors, the only thing that happens is that all your states from the previous setup get reset to the defaults each time. Therefore the initGU() call will make the initGraphics() obsolete, which in turn might be the cause for the image not showing up (because some important setup is missing then, probably something like sceGuEnable(GU_TEXTURE_2D ) or alike).

    what's the quickest way to read bytes/chars x-y from a char-array? Is there a better way than using a for-loop?
    No, there's no quicker way. Any time you read an amount of data or search for an unknown position you ALWAYS need a loop. The question if there's a BETTER way on the other side depends on the needs, but most likely there's no "better" way in this case.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  10. #1330
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Hm, wouldn't memcpy probably be faster? I mean I know the position (the offset and the length I want to read). If there's the a way to create a pointer that points to the point (omg my english *dies*), I mean a pointer that points to the offset where I want to read the string from, I could use memcpy to copy an excerpt from the string.

    Like (reading array[5]-array[10]):
    char * pArray = &array+5; // (pseudo-code)
    memcpy(stringExcerpt, pArray, 5);

    ?

  11. #1331
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    Hm, wouldn't memcpy probably be faster? I mean I know the position (the offset and the length I want to read). If there's the a way to create a pointer that points to the point (omg my english *dies*), I mean a pointer that points to the offset where I want to read the string from, I could use memcpy to copy an excerpt from the string.

    Like (reading array[5]-array[10]):
    char * pArray = &array+5; // (pseudo-code)
    memcpy(stringExcerpt, pArray, 5);

    ?
    Yes, that's true, I somewhat misunderstood your intention with "read x-y chars". If you want to copy some strings out of a longer one, that's the best (as in cleanest/best readable) way to go yes (if its faster depends on the length of the string to copy, because the overhead of the function call is not little and on the other side, memcpy also only does a loop [but optimized] - note though that all that is not really time-critical code, so it doesn't matter which solution you take, therefore the memcpy is still preferable).
    Well, at least the idea is right, the syntax not quite ;)
    Code:
    memcpy(stringExcerpt, &array[5], 5);
    That's the same in one single line. Copys 5 bytes starting from position 5.

    PS: You get my personal award for craziest funny sentence of the month
    If there's the a way to create a pointer that points to the point (omg my english *dies*)
    PPS: If you once really get into problems explaining yourself in english, you can always contact me in german too ;)
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  12. #1332
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Thanks again, Raphael!

    Now can somebody pls explain that errormessage to me?

    pspwamp_commands.c:84: error: 'for' loop initial declaration used outside C99 mode
    Line 84:

    Code:
    for(int i=1; i<=1; i++)

  13. #1333
    AKA Homer
    Points: 12.596, Level: 73
    Level completed: 37%, Points required for next Level: 254
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Sweden
    Beiträge
    1.779
    Points
    12.596
    Level
    73
    Downloads
    0
    Uploads
    0

    Standard

    You need to set the std to c99. Simply open up your makefile and add -std=c99 to the CFLAGS.

    You could also change it to
    Code:
    int i;
    for(i=1; i<=1; i++)


    Click Here if you want a Winamp Currently Playing Userbar like the one above.

  14. #1334
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Thanks!

  15. #1335
    QJ Gamer Blue
    Points: 5.768, Level: 49
    Level completed: 9%, Points required for next Level: 182
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    457
    Points
    5.768
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    Thanks again, Raphael!

    Now can somebody pls explain that errormessage to me?



    Line 84:

    Code:
    for(int i=1; i<=1; i++)
    thats wierd i got that error to and i just made it a c++ file. and it was gone.

  16. #1336
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    C++ includes the C99 standard, that'swhy with C++ that won't occur.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  17. #1337
    QJ Gamer Platinum
    Points: 57.528, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    h0000000rj
    Beiträge
    12.867
    Points
    57.528
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Code:
    for( leerlingen = 0; leerlingen < 21; ++leerlingen ) {
        
        cout << "geef de score van leerling " << leerlingen;
        cin >> punten[leerlingen-1];
        cout << endl;
    }
    Zitat Zitat von head_54us
    Woah. That would start from -1 not 0. On the first loop, leerlingen = 0, it doesnt increment until the end of the first loop.
    No... it increments before entering the loop, since the ++ is in the prefix position.
    [I fail @ life]

  18. #1338
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Over at php-resource.de (german) they say, you can simply send() a struct, recieve it, and, on the client, make it a struct again via a simple typeconversion. Can somebody confirm that?

  19. #1339
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FreePlay
    No... it increments before entering the loop, since the ++ is in the prefix position.
    No, the increment happens at the end of loop whether it is i++, ++i, i+=1 or i = i + 1. Seriously, try it.

    ++i increments before the expression of i is evaluated
    i++ increments after the expression of i is evaluated

    Code:
    for( int i = 0; i < 10; ++i )
             |         |     |--> Executed at the end of the loop
             |         |--> Executed at the beginning of the loop
             |--> Is initialised on entry to the for loop block
    Geändert von yaustar (10-16-2006 um 09:26 AM Uhr)

  20. #1340
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    Over at php-resource.de (german) they say, you can simply send() a struct, recieve it, and, on the client, make it a struct again via a simple typeconversion. Can somebody confirm that?
    Yes that's possible. It's as it stands there, data is just data, and a type or struct is just an interpretation of that data which can be exchanged (through typecasts).

    /*packet von irgendwo her gelesen*/
    /* packet ist vom typ char* */
    struct libnet_ip_hdr *ip_h = (struct libnet_ip_hdr*)packet;
    That's the typecast (from char* to struct libnet_ip_hdr*).
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  21. #1341
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    kewl sh*t!
    -= Double Post =-
    How do I allocate memory for multidimensional arrays? I have the following problem:

    Code:
    	typedef struct {
    		char * name;
    		char * albums;
    	} artist_entry;
    
    	artist_entry artist_list[517];
    
    	for(i=0;i<=517;i++)
    	{
    		// find out artist name and length
    		artist_list[i].name = (char*)malloc(artist_name_lenght+1);
    		strcpy(artist_list[i].name, artist_name);
    		artist_list[i].name[artist_name_lenght]='\0';
    
    		// find out number of albums, and album-names
    
    		// make albums an array for X (3 for example) albums
    
    		for(j=0;j<=X;j++)
    		{
    			artist_list[i].albums[j] = (char*)malloc(album_name_lenght+1);
    			[...]
    		}
    
    	}
    How do I create that album-array?
    Geändert von Lukeson (10-16-2006 um 10:18 AM Uhr) Grund: Automerged Doublepost

  22. #1342
    QJ Gamer Platinum
    Points: 57.528, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    h0000000rj
    Beiträge
    12.867
    Points
    57.528
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von head_54us
    No, the increment happens at the end of loop whether it is i++, ++i, i+=1 or i = i + 1. Seriously, try it.

    ++i increments before the expression of i is evaluated
    i++ increments after the expression of i is evaluated

    Code:
    for( int i = 0; i < 10; ++i )
             |         |     |--> Executed at the end of the loop
             |         |--> Executed at the beginning of the loop
             |--> Is initialised on entry to the for loop block
    That doesn't make any sense... In my experience, it executes the third argument of 'for' at the beginning of each iteration. I mean, you don't have to just increment a variable there... you can put any kind of code there you want.
    [I fail @ life]

  23. #1343
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    kewl sh*t!
    -= Double Post =-
    How do I allocate memory for multidimensional arrays? I have the following problem:

    Code:
    	typedef struct {
    		char * name;
    		char * albums;
    	} artist_entry;
    
    	artist_entry artist_list[517];
    
    	for(i=0;i<=517;i++)
    	{
    		// find out artist name and length
    		artist_list[i].name = (char*)malloc(artist_name_lenght+1);
    		strcpy(artist_list[i].name, artist_name);
    		artist_list[i].name[artist_name_lenght]='\0';
    
    		// find out number of albums, and album-names
    
    		// make albums an array for X (3 for example) albums
    
    		for(j=0;j<=X;j++)
    		{
    			artist_list[i].albums[j] = (char*)malloc(album_name_lenght+1);
    			[...]
    		}
    
    	}
    How do I create that album-array?
    Make that albums a double pointer, ie char** albums. Then before the inner for loop, allocate the albums array like that: artist_list[i].albums = malloc( X*sizeof(char*) );
    The rest is good already. Just be sure to free that array in the reverse order, ie first loop through albums[j] and free each and after that, free the albums.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  24. #1344
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    crosspost

  25. #1345
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FreePlay
    That doesn't make any sense... In my experience, it executes the third argument of 'for' at the beginning of each iteration. I mean, you don't have to just increment a variable there... you can put any kind of code there you want.
    But headus is right there. The last part in the for loop is executed at the end, therefore it doesn't matter if the increment is prefixed or postfixed. You can easily try that by doing
    Code:
    for (i=0;i<3;++i) printf("%i,", i);
    and it will print 0,1,2,
    then you can also try that to get absolutely sure that the stuff in the last part is executed AFTER the loop, by inserting another printf("++"); before the ++i. The output will now be 0,++1,++2,++
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  26. #1346
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Thanks for the quick answer, just one las question; How do I set the String-null-terminator? Lke this?

    Code:
    for(j=0;j<=X;j++)
    {
    artist_list[i].albums[j] = (char*)malloc(album_name_length+1);
    strcpy(artist_list[i].albums[j], album_name);
    artist_list[i].albums[j][album_name_length]='\0';
    }

  27. #1347
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    Thanks for the quick answer, just one las question; How do I set the String-null-terminator? Lke this?

    Code:
    for(j=0;j<=X;j++)
    {
    artist_list[i].albums[j] = (char*)malloc(album_name_length+1);
    strcpy(artist_list[i].albums[j], album_name);
    artist_list[i].albums[j][album_name_length]='\0';
    }
    Yes, exactly.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  28. #1348
    Tokes
    Points: 14.098, Level: 77
    Level completed: 12%, Points required for next Level: 352
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    1.112
    Points
    14.098
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    How do i clean the screen? Or make it go to sleep after displaying some txt?
    PAPER IS MY GOD AND WEED IS MY SOUL

  29. #1349
    QJ Gamer Blue
    Points: 4.511, Level: 42
    Level completed: 81%, Points required for next Level: 39
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Germany
    Beiträge
    216
    Points
    4.511
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    1.) clearScreen(RGB(0, 0, 0));

    2.) sceKernelSleepThread();

  30. #1350
    Tokes
    Points: 14.098, Level: 77
    Level completed: 12%, Points required for next Level: 352
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    1.112
    Points
    14.098
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Lukeson
    1.) clearScreen(RGB(0, 0, 0));

    2.) sceKernelSleepThread();
    Thank you :)
    PAPER IS MY GOD AND WEED IS MY SOUL


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:28 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .