NH>>> switch (foo) {
NH>>> case 1 :
NH>>> int bar = 2;
NH>>> break;
NH>>> case 2 :
NH>>> int bar = 3;
NH>>> break;
NH>>> }
MB>> in C/C++, lack of initialization is not an error. the error is that
MB>> there are two identical variable names.
DM> Nope... both are errors. Have you tried it on your compiler before
DM> posting, or did you just post? Try compiling an example, first...
Using TC++ 3.00,
Turbo C++ Version 3.00 Copyright (c) 1992 Borland International
z.cpp:
Error z.cpp 7: Multiple declaration for 'patate' in function main(int)
Warning z.cpp 9: 'patate' is assigned a value that is never used in
function mai
n(int)
*** 1 errors in Compile ***
that's all.
(the warning is irrelevant to our problem here)
only 1 error. i'll try it in GCC in a few minutes..
matju
--- Terminate 4.00/Pro
---------------
* Origin: The Lost Remains Of SatelliteSoft BBS (1:163/215.42)
|