|
From: Ioannis V. <no...@ho...> - 2002-11-20 18:49:05
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Paul Ardeleanu
> Sent: Tuesday, November 19, 2002 10:56 PM
> To: dev...@li...
> Subject: [Dev-C++] 2 more questions
>
>
> Hi again!
> Is there an equivalent of clrscr() in Dev-C++?
> Also can you give me a solution for the counting characters program?
> I tried the following but it seems that the printf statement is not
> executed.
> Thank you!
> Paul
>
>
> #include <stdlib.h>
> #include <stdio.h>
>
> void main(void)
int main(void)
> {
> double nc;
> for(nc=0;getchar()!=EOF;nc++)
> ;
> printf("%.0f\n",nc);
printf("%.0lf\n", nc);
> system("PAUSE");
return 0;
> }
What do you mean? The above fixed-to-be-portable code works:
C:\c>temp <temp.c
182
Press any key to continue . . .
C:\c>
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
|