1 Replies - 13067 Views - Last Post: 09 November 2012 - 06:20 PM

#1 Finalfront  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 19-July 12

C++/CLI StreamReader ReadToEnd() only getting first digit of double

Posted 19 July 2012 - 05:58 PM

I have an input file containing the double 51.5601707265774, and when i open it in the dialogue box as defined bellow, only the digit five shows up in the message box. What could be the cause of this? How can I fix it?

	private: void btnAddTime_Click(System::Object ^ sender, System::EventArgs ^ e)
			 {

				 if(openHeartRateFile->ShowDialog() == System::Windows::Forms::DialogResult::OK)
				 {
					 System::IO::StreamReader ^ sr = gcnew System::IO::StreamReader(openHeartRateFile->FileName);
					 sTemp = sr->ReadToEnd();
					 MessageBox::Show(sTemp);
					 sr->Close();
				 }
			 }


Is This A Good Question/Topic? 0
  • +

Replies To: C++/CLI StreamReader ReadToEnd() only getting first digit of double

#2 miltonneal  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 7
  • Joined: 09-November 12

Re: C++/CLI StreamReader ReadToEnd() only getting first digit of double

Posted 09 November 2012 - 06:20 PM

Hi
Is the file you are trying to open a text or binary file?
I would suggest from your result that it could be a binary file!
If it's a binary file then you should be using System::IO::BinaryReader

Milton...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1