I am having a rather interesting problem. I was doing a program and I was trying to read a string in a subfunction after reading an integer in main function. Now a problem occured, I couldnt read the string. The reading of string does not work.
It worked properly when the subfunction was called without reading the integer. The problem showed up when I tried to call the fucntion after reading the integer.
This is a small program which depicts the bug.
I would love to know the reason for this strange problem.
I tried flushing the stdin also. It didnt work as well.