Re: please help me to reverse a function call order

2022-07-24 Thread test123 via Digitalmars-d-learn
On Sunday, 24 July 2022 at 15:49:51 UTC, Salih Dincer wrote: On Sunday, 24 July 2022 at 15:11:45 UTC, Salih Dincer wrote: ...But you know this classic recurisive function: The `permut()` function works with many types, for example `char`. Look at probability 40: 😀 ```d void main() { int t

Re: Using "%s" with inputting numberic values

2022-07-24 Thread pascal111 via Digitalmars-d-learn
On Sunday, 24 July 2022 at 23:48:59 UTC, Adam D Ruppe wrote: On Sunday, 24 July 2022 at 23:12:46 UTC, pascal111 wrote: [...] The D things in std.stdio, writef and readf, use %s to just mean default for the given type. Since you passed it an int, the function knows it got an int (this is diff

Re: Using "%s" with inputting numberic values

2022-07-24 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 24 July 2022 at 23:12:46 UTC, pascal111 wrote: In the next code, we used "%s" format with receiving an integer value, while from C experience, we know that we use "%d" or "%i" formats, so what "%s" stands for here, I guess it's for receiving string data type? The D things in std.st

Using "%s" with inputting numberic values

2022-07-24 Thread pascal111 via Digitalmars-d-learn
In the next code, we used "%s" format with receiving an integer value, while from C experience, we know that we use "%d" or "%i" formats, so what "%s" stands for here, I guess it's for receiving string data type? import std.stdio; void main() { write("How many students are there?

Re: Using LDC2 with --march=amdgcn

2022-07-24 Thread Johan via Digitalmars-d-learn
On Sunday, 24 July 2022 at 18:44:42 UTC, realhet wrote: Hello, I noticed that the LDC2 compiler has an architecture target called "AMD GCN". Is there an example code which is in D and generates a working binary of a hello world kernel. I tried it, and just failed at the very beginning: How

Using LDC2 with --march=amdgcn

2022-07-24 Thread realhet via Digitalmars-d-learn
Hello, I noticed that the LDC2 compiler has an architecture target called "AMD GCN". Is there an example code which is in D and generates a working binary of a hello world kernel. I tried it, and just failed at the very beginning: How can I specify __kernel and __global in D?

Re: please help me to reverse a function call order

2022-07-24 Thread Salih Dincer via Digitalmars-d-learn
On Sunday, 24 July 2022 at 15:11:45 UTC, Salih Dincer wrote: ...But you know this classic recurisive function: The `permut()` function works with many types, for example `char`. Look at probability 40: 😀 ```d void main() { int totalCount; ['a', 'd', 'g', 'l', 'n'].permut(totalCount); t

Re: please help me to reverse a function call order

2022-07-24 Thread Salih Dincer via Digitalmars-d-learn
On Sunday, 24 July 2022 at 08:16:41 UTC, Test123 wrote: On Saturday, 23 July 2022 at 23:14:03 UTC, Salih Dincer wrote: On Saturday, 23 July 2022 at 22:50:55 UTC, Salih Dincer wrote: [...] I guess my code didn't list all possibilities either. Moreover, the m and n parameters will be swapped:

Re: please help me to reverse a function call order

2022-07-24 Thread Test123 via Digitalmars-d-learn
On Saturday, 23 July 2022 at 23:14:03 UTC, Salih Dincer wrote: On Saturday, 23 July 2022 at 22:50:55 UTC, Salih Dincer wrote: [...] I guess my code didn't list all possibilities either. Moreover, the m and n parameters will be swapped: [...] **PS.** * marked from version(c) in the above