thnx ben..i've already figured tht out in my prev post...im sorry to people for not figuring it out with the buffer..sorry 4 all the bad blood...but thnx for helping
Type: Posts; User: rickyspaceguy
thnx ben..i've already figured tht out in my prev post...im sorry to people for not figuring it out with the buffer..sorry 4 all the bad blood...but thnx for helping
sorry people i at last figured it out...i didnt know tht a return is what makes stdin available to getchar()..
im sorry for all the bad blood
ctrl+z is the EOF in windows...i figured it out how...
hey pls...
c:\MinGW\bin>c:\MinGW\work\count.out
jbjsann nsjandjndsn kksak
nmjbjj
characters:27 space:3 tabs:0 Newlines:1 ^C
this was reached with ctrl+c command...if the process was wholly...
well dear friend i can wish to be accepted as a jackass but not stubborn...im trying to know wat is happening..i use ctrl+z all the time..but the loop won't end so i tried using ctrl+c..
sumtimes...
thanks ben for the first serious attempt...
this is the command i give @ my windows cmd prompt alongwith the results..can u still find why is this happening??
c:\MinGW\bin>mingw32-gcc...
i already know tht..ctrl D is infact used for unix while windows uses ctrl+z... but here gcc compiler doesnt tk ctrl+z or ctrl+d as EOF..i donno y is such a thing happening..btw im using a windows...
pls refer to my original post here
& u may like to see this too..
Microsoft Windows [Version 6.0.6000]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.
C:\Users\Ricky>cd c:\MinGW\bin
c:\MinGW\bin>mingw32-gcc c:\MinGW\work\count.c -o...
pls see the above example code i posted..well it does tk it to next line of logic...why???
bcos it does give correct answer albeit not always...thts my actual problem
it w'd b better if u...
#include<stdio.h>
int main(){
int c,nl;
nl=0;
while((c=getchar())!=EOF)
if(c=='\n')
++nl;
printf("\n%d\n",nl);
i already know tht bud..can u compile the code then try to run it...but do tell me if u used unix or windows m/c
my program doesnt have loops...?? thr is a while loop sitting..
fflush doesnt help too same problems....
look people...i've mistakenly copied EOF as 'EOF' i had already detected & tried to edit b4 ne1 replied..but i don't know why wasn't it updated..
others who say tht y haven't i used Ctrl+z as...
#include<stdio.h>
/* program to calculate no of tabs,spaces,tabs alongwith characters */
int main(){
int c;
int nc,nspc,ntb,nline;
nc=nspc=ntb=nline=0;
c='\0';