| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
July 25, 2004 calling function withouth () | ||||
|---|---|---|---|---|
| ||||
<CODE>
import std.stdio;
int func()
{
writefln("HAHA");
return 0;
}
void main ()
{
func;
getch();
}
</CODE>
The function isn't actually called but this compiles and runs
but doesn't call func();
| ||||
July 25, 2004 Re: calling function withouth () | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | Funny: :)
This calles the function:
<CODE>
import std.stdio;
int func()
{
writefln("HAHA");
return 0;
}
void main ()
{
func + 0;
getch();
}
</CODE>
Also for example this works:
-func; //calls the function.
So! We have partial global properties in D? :)
"Ivan Senji" <ivan.senji@public.srce.hr> wrote in message news:ce10fg$2jja$1@digitaldaemon.com...
> <CODE>
> import std.stdio;
>
> int func()
> {
> writefln("HAHA");
> return 0;
> }
>
> void main ()
> {
> func;
> getch();
> }
> </CODE>
>
> The function isn't actually called but this compiles and runs
> but doesn't call func();
>
>
>
| |||
July 25, 2004 Re: calling function withouth () | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | "Ivan Senji" <ivan.senji@public.srce.hr> wrote in message news:ce10l5$2jol$1@digitaldaemon.com... > Funny: :) > > This calles the function: > > <CODE> > import std.stdio; > > int func() > { > writefln("HAHA"); > return 0; > } > > void main () > { > func + 0; > getch(); > } > </CODE> > > Also for example this works: > > -func; //calls the function. > > > So! We have partial global properties in D? :) > The code had to be funny to make it laugh ;) I think there should be global properties. | |||
July 26, 2004 Re: calling function withouth () | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | !!
we DO have global properties!!
import std.c.stdio;
import std.string;
int m_x;
int x(int y) { return m_x=y; }
int x() { return m_x; }
void main()
{
x=5;
printf("%d\n",x);
}
| |||
July 26, 2004 Re: calling function withouth () | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | sorry if my last post came across as angry or patronizing, i was happy and forgot to put in a " :) ". :) | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply