In article <1990Mar26.110639.12
...@newcastle.ac.uk> Lindsay.Marsh
...@newcastle.ac.uk (Lindsay F. Marshall) writes:
>This code (which passes CC) :-
>void example()
>{
> char x[80];
> char (&refx)[] = x;
>}
I came across this with function pointers. It seems as if g++ gets confused
when it sees the `(' after `char'.
Fix: put the keyword `auto' in front. eg, `auto char (&refx)[] = x;'
It worked for the function pointer problem and compiled (have tested
execution) for your example.
This only seems to be a problem with local variables. I've used
function pointers successfully as class members without `auto'.
-Daniel
Daniel Pezely <pez...@udel.edu> (NSFnet) 728 Bent Ln, Newark, DE 19711 | Skate
Comp Sci Lab, Smith Hall, U of Delaware, Newark, DE 19716; 302/451-6339 | ICE