Beta 2.099.0

forkit forkit at gmail.com
Wed Feb 16 07:23:50 UTC 2022


On Wednesday, 16 February 2022 at 06:55:57 UTC, Rainer Schuetze 
wrote:
>

yep. working just fine now :-)


// --- compile with -betterC

import core.stdc.stdio;

extern(C):

FILE* __acrt_iob_func(int hnd);
FILE* stdin()() { return __acrt_iob_func(0); }
FILE* stdout()() { return __acrt_iob_func(1); }
FILE* stderr()() { return __acrt_iob_func(2); }

int main()
{
     fprintf(stdout, "Enter a character: ");

     int ch;
     ch = getc(stdin);

     if (ch == '\n')
     {
         fprintf(stderr, "You didn't enter a character.\n");
     }
     else
     {
         printf("You entered %c \n", ch);
     }

     return 0;
}

// ---


More information about the Digitalmars-d-announce mailing list