Properties no longer work?

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Sat Jul 29 06:30:43 PDT 2006


Jarrett Billingsley wrote:
> "Bruno Medeiros" <brunodomedeirosATgmail at SPAM.com> wrote in message 
> news:eabhs0$2kkr$1 at digitaldaemon.com...
> 
>> C has them? Where did you see that, I was under the impression that C only 
>> had function pointers, and they were all the same, such that the value a 
>> function was the same as the value of taking the address of the function:
>> (func) == (&func)

Ok, I now realize they are subtly different: although the value is the 
same ( func) == (&func) ) , one can "&" a "func" but can't "&" a "&func" 
(ie, one can't indefinitely use operator "&") , so that's a small 
difference. :p

> 
> I'm not sure, but I think that skipping the & on getting a function pointer 
> in C is an "extension", or part of the newest standard that not all 
> compilers support.
> 

Nope, I think it's there since K&R ANSI C, although I don't have the 
book here with me to confirm.

> Function types are allowed in C; you can't have an array of functions.
> 
>> Similarly to what happens to arrays.
> 
> Mm?  I thought
> 
> char x[];
> x is char*
> &x is char** 
> 
> 

"char x[];" is not valid C. "char x[]" is only valid when there is an 
array initializer "char x[] = {...};", or as a function parameter type, 
but in this latter case it is not an array, it is a char pointer (char*).

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-learn mailing list