A problem with C functions

Discussion in 'Software' started by Xocoatl, Dec 5, 2006.

  1. Xocoatl

    Xocoatl Private E-2

    I need a bit of help regarding editing the contents of parameters given to a function when written in C.

    What I'm trying to do is, in a void function, given a pointer and a few other parameters, the pointer gets updated depending on the parameters and passed on to the main program it was called from (i.e: the value isn't lost after the function ends)

    Now I know that, in order to make any other regular datatype modifyable as a parameter in a function, you call the parameter as a pointer and instead pass the address of the value you want to alter...

    i.e: "void addition (int A, int B, int *C)" will return the addition of A and B into C.

    But when you need to alter a pointer, what do you do? I can't quite figure it out because you're already calling a pointer with the previous method, and quite expectably, it doesn't work.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds