Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
"getline" bug fix for VC++ 6.0

 
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum
Author Message
dinangkur
Super Moderator
Super Moderator


Joined: 24 Mar 2004
Posts: 491
Location: Dhaka, Bangladesh

Post Post subject: "getline" bug fix for VC++ 6.0 Reply with quote

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...
Wed Jun 16, 04 2:26 am
Back to top
dinangkur View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Programming in Java, C, C#, VB, .NET Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group