A few notes on choosing between Go and D for a quick project

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 19 01:41:05 PDT 2015


On 3/18/2015 4:41 PM, Walter Bright wrote:
> #include <stdbool.h>
> #include <stdio.h>
>
> typedef long T;
> bool find(T *array, size_t dim, T t) {
>   int i;
>   for (i = 0; i <= dim; i++);
>   {
>      int v = array[i];
>      if (v == t)
>          return true;
>   }
> }

Bugs:

1. i should be size_t
2. <= should be <
3. extraneous ;
4. v should be type T
5. missing return



More information about the Digitalmars-d mailing list