Hi
ok i just tried to replace gets with fgets and when i run the program with the scanf function remed out it still skips the fgets function and doesnt allow me to enter the input from stdin.
Thanx
Code:
# include <stdio.h>
# include <conio.c>
/********************************** FUNCTION PROTOTYPES ********************/
int test(void);
/********************************** BEGIN MAIN ****************************/
int main(int argv, char *argc[])
{
int number;
printf("Enter a number:");
scanf("%d",&number);
switch (number){
case (1):
test();
break;
}
system("PAUSE");
return 0;
}
/********************************** FUNCTION ******************************/
int test(void)
{
int f;
char name_test[20];
clrscr();
printf("Program is here");
//scanf("%d",&f); /*i dont want to use this to pause prog flow
fgets(name_test,20,stdin); /*MODIFIED LINE*/
printf(name_test);
return 0;
}