Hi,

I've the following code in main() function.. The scanf is written to read multiple strings in a single array of char:
-----
--
Code:
else
            {
                printf("\n\n MODULAR VIEW \n");
                printf("cmd> Type help to get help \n");
                printf("cmd>");                
                scanf("%[^\n]",usr_in);          
                help_module(usr_in);
            }
The prototype of the called function is:
Code:
void help_module(char *);
The variable declaration is:
Code:
char user_in[80]
This segfaults during execution.:

0 -> Traditional View
Other -> Modular View
Enter your choice :1


MODULAR VIEW
cmd> Type help to get help
Segmentation fault

The surprising point here is that - its getting segfault before scanf. Means its just printing the printf statements and then segfault. Why so? I've checked by putting some more printf's before the function call and scanf. But anytime its not reading any value through scanf. Simply segfaults. What may be the reason here?