halo all,
i've two problems.
1.i want my program to take input few lines and output those lines in whose character length is greater than 8.here's my code
Code:
#include<stdio.h>
#include<conio.h>
#define MAX 1000
int main(void)
{
int i,c[MAX],j,len;
for(i=0;(c[i]=getchar())!=EOF;i++);
i=0;
while(c[i]!=EOF)
{
for(len=0;c[i]!='\n';len++,i++);
if(len>8)
{
for(i=0;c[i]!='\n';i++)
putchar(c[i]);
}
}
getch();
return 0;
}
but when i run this program,it gives wrong output.its output is based on the first line inputted.if the first line has more than 8 chars then it gets printed otherwise not.it doesn't goes to the second line.so please tell me what i should modify in the program to get proper output.
2.i've recently switched to microsoft visual studio 2005.i want to know how can i debug the program step by step or in other words how do i trace the program.
Thank You