View Single Post
Old 03-21-2003, 05:16 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
i think the program is executing and exiting so quick that you can't see the output .. try this:
Code:
#include <stdio.h>

/*count chars in input, 1st version*/

main ()
{
	long nc;

	nc = 0;
	while (getchar() != EOF)
		++nc;
	printf("%ld\n", nc);

	printf("\n\n Press any key to exit.");
	
	getchar(); 
}
i'm sorta a n00b myself, but i think this will do it.
sde is offline   Reply With Quote