I don't know how many people faced this problem and banged their head with keyboard. But I certainly did last year for few hours :)
If you're trying to read a string object with "getline", you will find that in order to continue you need to press "enter" twice. I didn't know it was VC complier bug. I thought i did something wrong and cursed me for few hours.
Later searching on the net I've found that it's complier bug. Following is how to fix it in your VC++ 6.0 complier. Remember you need to do it just for one time in your home PC, unfortunately, if you're using network PC, you may have to do this each time if you move to different machines, or if the machine have been re-imaged.
1. Right click on the #include<string> in your header
2. Choose "open document string" from pull down menu
3. click on "edit", then "find"
4. Enter the string in the search box "else if (_Tr::eq((_E)_C, _D))"
5. Make the change in following code
Orginal:
| Code: |
else if (_Tr::eq((_E)_C, _D))
{_Chg = true;
_I.rdbuf()->snextc();
break; }
|
Modified:
| Code: |
else if (_Tr::eq((_E)_C, _D))
{_Chg = true;
_I.rdbuf()->sbumpc(); // corrected code
break; }
|
6. Save and close the string header file.
-DK.
_________________
...we too are stardust...