Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!sun-barr!texsun!texbell!cs.utexas.edu!milano!marconi!knutson From: knutson@marconi.sw.mcc.com (Jim Knutson) Newsgroups: gnu.g++ Subject: What am I missing? Message-ID: <2637@marconi.sw.mcc.com> Date: 18 Jul 89 02:09:37 GMT Organization: MCC, Austin, TX Lines: 30 Why shouldn't the compiler at least flag this with a warning? If not at parse time, then at least at load time. Aren't the function names munged to include parameter types? #include int data[10] = { 4, 7, 12, 5, 0, 3, 87, 445, -2, 10 }; main() { int j, i; void swapit(int i, int j); // <<< Non-reference parameters for (j = 0; j < 10; j++) { for (i=j+1; i < 10; i++) { if (data[i] < data[j]) swapit(data[i],data[j]); } } for (i = 0; i < 10; i++) cout << data[i] << " "; cout << "\n"; } // vvvvvv Reference parameters void swapit(int& i, int& j) { int temp = i; i = j; j = temp; } -- Jim Knutson knutson@mcc.com cs.utexas.edu!milano!knutson