Seite 177 von 340 ErsteErste ... 77 127 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 227 277 ... LetzteLetzte
Zeige Ergebnis 5.281 bis 5.310 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 AdjutantReflex I see that's the source I used in my personal Lua Player w/ IR support (and flasing ...

  
  1. #5281
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von AdjutantReflex
    I see that's the source I used in my personal Lua Player w/ IR support (and flasing and directory dumping functions) I made 4 months or so ago (eww it's all sloppy...). How'd that get out? I think i gave it to one person... not sure... either way, you just gotta ask yourself whether this code will launch an eboot:
    Code:
    sceKernelLoadExec(path,NULL);
    If so, then yes :)
    Nope, that won't run. IIRC, sceKernelLoadExec() doesn't even take a path as a parameter.



  2. #5282
    QJ Gamer Green
    Points: 8.244, Level: 61
    Level completed: 32%, Points required for next Level: 206
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Cd. Juarez Mexico -
    Beiträge
    341
    Points
    8.244
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von FistPump
    Nope, that won't run. IIRC, sceKernelLoadExec() doesn't even take a path as a parameter.
    Are you sure, because it worked in a simple test program i did.

    SCRIPTint main()
    {
    pspDebugScreenInit();
    SetupCallbacks();

    sceKernelLoadExec("ms0:/eboot.pbp",NULL);

    sceKernelSleepThread();
    return 0;
    }


    And in the header file it states:

    SCRIPT/**
    * Execute a new game executable, limited when not running in kernel mode.
    *
    * @param file - The file to execute.
    * @param param - Pointer to a ::SceKernelLoadExecParam structure, or NULL.
    *
    * @return < 0 on error, probably.
    *
    */
    Firmware History2.0 > 2.01 > 2.6 > 2.7 (Upgraded since i lost my GTA) > 2.71 > 2.8 (Downgrader for 2.71 came next day :( ) > 2.8 (xLoader very happy) > Stolen > New 2.6 PSP > 2.71 > 1.5 > 2.71 SE > 3.03 OE-A > 3.03 OE-B > 3.03 OE-C > 3.40 OE (For my theme cycler)
    Donators
    310,000 points from xpack
    1,000,000 points from Steven9
    1,000,000 points from nanajyuuta
    PREMIUM - Dev Status
    Thanks!!!


    XMB Theme Manager Creator - now at version V0.3

  3. #5283
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Look here. You need to pass a struct to the second param, not null.
    -= Double Post =-
    Something like this, I would say:

    Code:
    int plEbootLoad(char* pathToPbp)
    {
    	if(strlen(pathToPbp) <= 0)
    	{
    		printf("Must pass the location of the PBP file.\n");
    		return 0;
    	}
    	
    	struct SceKernelLoadExecVSHParam pbpParam;
    	memset(&pbpParam, 0, sizeof(pbpParam));
    	
    	pbpParam.size = sizeof(pbpParam);
    	pbpParam.args = (strlen(pathToPbp) + 1);
    	pbpParam.argp = pathToPbp;
    	pbpParam.key = "game";
    	
    	if(sceKernelLoadExec(pathToPbp, &pbpParam) < 0)
    	{	
    		return 0;
    	}
    	
    	return 1;
    }
    Geändert von PSPJunkie_ (07-01-2007 um 10:51 PM Uhr) Grund: Automerged Doublepost

  4. #5284
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    What does "nan" mean in floats?

  5. #5285
    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 Mr305
    What does "nan" mean in floats?
    Not A Number.

    http://en.wikipedia.org/wiki/NaN

  6. #5286
    QJ Gamer Green
    Points: 8.244, Level: 61
    Level completed: 32%, Points required for next Level: 206
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Cd. Juarez Mexico -
    Beiträge
    341
    Points
    8.244
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Ok i got it, i will do it.
    Firmware History2.0 > 2.01 > 2.6 > 2.7 (Upgraded since i lost my GTA) > 2.71 > 2.8 (Downgrader for 2.71 came next day :( ) > 2.8 (xLoader very happy) > Stolen > New 2.6 PSP > 2.71 > 1.5 > 2.71 SE > 3.03 OE-A > 3.03 OE-B > 3.03 OE-C > 3.40 OE (For my theme cycler)
    Donators
    310,000 points from xpack
    1,000,000 points from Steven9
    1,000,000 points from nanajyuuta
    PREMIUM - Dev Status
    Thanks!!!


    XMB Theme Manager Creator - now at version V0.3

  7. #5287
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Hmmm... for some reason my code that i ported isn't working at all...
    Nothing is displayed.
    Here are the files:
    http://mihd.net/09qzvw
    The main.c:
    Code:
    #include <pspdisplay.h>
    #include <stdlib.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include <time.h>
    #include <psppower.h>
    #include <pspaudio.h>
    #include <pspaudiolib.h>
    #include "graphics.h"
    #define true 1
    #define false 0
    PSP_MODULE_INFO("BallBounce Test", 0, 1, 1);
    /* 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 >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    char *path[2] = { "BGimage.png",  //0
                               "Ball.png"};       //1
    int main()
    {
    
    	SetupCallbacks();
        pspDebugScreenInit();
        initGraphics();
        int x = 0;
        int y = 0;
        Image* images[2];
        int i;
        for(i = 0; i < 2; i++)
        {
              images[i] = loadImage(path[i]);
        }
        while(1)
        {
    
        blitAlphaImageToScreen(0 ,0 ,32 , 32, images[1], x, y);
        blitAlphaImageToScreen(0 ,0 ,480 , 272, images[0], 0, 0);
    sceDisplayWaitVblankStart();
    flipScreen();
     	}
        sceKernelSleepThread();
        return 0;
    }
    The makefile
    Code:
    TARGET = BouncingBallDemo
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm -lpsprtc -lmad -lpspaudiolib -lpspaudio -lpsppower
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Bouncing Ball Demo
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak

  8. #5288
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    I'm having a problem again loading modules :Argh:

    Using the pspSdkLoadStartModule, I sometimes load the modules fine, and other times... well I get an error message, and 0x44088000 as the error code.

    I can load perfectly in 3.10, but when trying to run this in 1.50, I seem to get that error code a lot.

    I've tried looking through and finding what exactly is causing the error, but to no avail, its not based on the loading code, because the exact same code can load another module perfectly, and the modules that won't work sometimes work when loaded from elsewhere...

    Thanks for any help
    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  9. #5289
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Nicko01
    Hmmm... for some reason my code that i ported isn't working at all...
    Nothing is displayed.
    Here are the files:
    http://mihd.net/09qzvw
    The main.c:
    Code:
    #include <pspdisplay.h>
    #include <stdlib.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include <time.h>
    #include <psppower.h>
    #include <pspaudio.h>
    #include <pspaudiolib.h>
    #include "graphics.h"
    #define true 1
    #define false 0
    PSP_MODULE_INFO("BallBounce Test", 0, 1, 1);
    /* 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 >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    }
    char *path[2] = { "BGimage.png",  //0
                               "Ball.png"};       //1
    int main()
    {
    
    	SetupCallbacks();
        pspDebugScreenInit();
        initGraphics();
        int x = 0;
        int y = 0;
        Image* images[2];
        int i;
        for(i = 0; i < 2; i++)
        {
              images[i] = loadImage(path[i]);
        }
        while(1)
        {
    
        blitAlphaImageToScreen(0 ,0 ,32 , 32, images[1], x, y);
        blitAlphaImageToScreen(0 ,0 ,480 , 272, images[0], 0, 0);
    sceDisplayWaitVblankStart();
    flipScreen();
     	}
        sceKernelSleepThread();
        return 0;
    }
    The makefile
    Code:
    TARGET = BouncingBallDemo
    OBJS = main.o graphics.o framebuffer.o
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpng -lz -lm -lpsprtc -lmad -lpspaudiolib -lpspaudio -lpsppower
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Bouncing Ball Demo
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    Long time, no see!

  10. #5290
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    lol.... I took a break from programming a few months to play WoW.
    I'm not sure why this always happens, but for some reason my stupid screen never is displayed.

  11. #5291
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Nicko01
    lol.... I took a break from programming a few months to play WoW.
    I'm not sure why this always happens, but for some reason my stupid screen never is displayed.
    D'oh.

  12. #5292
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    what? dont like World of Warcraft?

  13. #5293
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Well, you can say I'm wow-o-phobic. :P But, hey, we go back a long way, so whatever.


    http://elite.proboards79.com :P Idiots United...

  14. #5294
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    You were on idiots united???
    What was your name?

  15. #5295
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    It's PSPJunkie :P

  16. #5296
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    :) I should have known because of the NY Giants thing.
    Well, lets get back on topic...

    Can you see a problem?

  17. #5297
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Did you run it through PSPLink?

  18. #5298
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    no

  19. #5299
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Got it!

    'BGimage.png' is not actually a PNG file. If you ran it through PSPLink, you would see that libpng throws out an error (You don't notice it because it is with printf which doesn't go the PSPs screen). Rename 'BGimage.png' to 'BGimage.bmp' and resave it as a PNG in you preferred image editing program.

    That's it :P

    Although, just so you know, you blit the ball first, so the background in front of it and you will never see it. :P



    EDIT: I attached the converted image.
    Miniaturansicht angehängter Grafiken Miniaturansicht angehängter Grafiken C/C++ Programming Help Thread-bgimage.png  

  20. #5300
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    oh cool.
    thanks.

    well, when i converted it, it must have been converted wrong.

    lol... i didn't even put all of my code in there...
    i forgot the whole bouncing part.

  21. #5301
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    No problem. When libpng threw the error, I just opened the file in a hex editor and saw the header was BMP.

  22. #5302
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    hi i'm still learning......
    if i have something like this

    Code:
    int scePowerGetBatteryLifePercent(void);
    how would i use it to print battery life?

  23. #5303
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    how that works is that the int means it will be an interger.
    void means it takes no parameters

    This shows how to make it into a variable which can be used in all kinds of things:
    Code:
    int PowerRemaining = scePowerGetBatteryLifePercent();

  24. #5304
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    yeah thats what i thought:

    Code:
    int bat = scePowerGetBatteryLifePercent();
    but im getting error:

    $ make
    psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=
    150 -c -o main.o main.c
    main.c:20: error: initializer element is not constant //this is that line
    make: *** [main.o] Error 1
    and also at the top i have:

    # include <psppower.h>

  25. #5305
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    make sure you have these:
    Code:
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspctrl.h>
    #include <pspdisplay.h>
    #include <stdio.h>
    #include <pspmoduleinfo.h>
    #include <psppower.h>

    make sure this is in your makefile
    Code:
    LIBS = -lpsppower

  26. #5306
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    still same error o_O strange....... but anyway thx for help ;)

    probably im doing something wrong...

    and how would you print it? just:

    printf("%d",bat)

    ??

  27. #5307
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    c:\Program Files\World of Warcraft\WoW.exe
    Beiträge
    98
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    yeah, thats right, as long as you have
    Code:
    #define printf  pspDebugScreenPrintf
    in there.

  28. #5308
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    when making a function how can i return the info to the input command for example:

    void function(int input){
    input = 6;
    }
    int number=3;

    function(number);

    of course this isn't practical however how would i return the input 6 to number so i change it's value to 6 while keeping the function void and no need for a return
    1. Failed....again...
    2. http://slicer.gibbocool.com/ stay updated on all my projects
    3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been

  29. #5309
    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 slicer4ever
    when making a function how can i return the info to the input command for example:

    void function(int input){
    input = 6;
    }
    int number=3;

    function(number);

    of course this isn't practical however how would i return the input 6 to number so i change it's value to 6 while keeping the function void and no need for a return
    C or C++?

  30. #5310
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever
    when making a function how can i return the info to the input command for example:

    void function(int input){
    input = 6;
    }
    int number=3;

    function(number);

    of course this isn't practical however how would i return the input 6 to number so i change it's value to 6 while keeping the function void and no need for a return
    void function(int *input)
    {
    *input=6;
    }

    function(&number);

    That's what U wanted?


 

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:14 PM Uhr.

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