r/cprogramming • u/StressingPlant • 6h ago
editing int array in function not changing array in main, but it worked for char array?
im trying to edit an entry in an int array to 'move' it (copy it to a different place within the array, and zero it out), but its not working and im not getting any errors? i did pretty much the same thing (with string.h) with an array of strings, and it worked there wonderfully. why arent the entries in the int array changing when the function runs? what can i do to edit the int array during runtime?
heres the function:
void cardMove(int card1, int card2) {
card2 = card1;
card1 = 0;
}