hi,help me out i m new to C
i have made one program and i am facing a bit of problem with that can anyone here help me.here is the source
Code:
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0;
char ch[25],c;
printf("enter ur name n press 0 to exit");
do{
c=getch();
ch[i]=c;
i++;
}while(c!='0');
i=i-1;
ch[i]='\0';
}
this is the program asking the user to enter his/her name and end the program by pressing '0'...name should be entered with one by one character for example: name is happy user should enter h first then a then p ans so on and then press 0 to end it...everything is running fine but i m getting it's output..when program is compiled it ask the yser to enter the name but when i tried to enter the name it doesnot enter anything but when i press 0 then it ends the progarm....so tell me how to get the output
thaxs
regards
Karun

Last edited by shabbir; 29Nov2006 at 09:00.. Reason: Code formating.