Posts by DarkBR • 23 points
1 post
-
2
votes1
answer53
viewsQ: Why do different types of variables give different results when modified in a function?
I can’t understand why x and v[0] are different. void edit1 (int x) { x = 9 * x; } void edit2 (int v[]) { v[0] = 9 * v[0]; } int main () { int x, v[2]; x = 678; edit1 (x); printf (" x: %d\n" , x);…