Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Print the date on in a text box

$
0
0

Hey, I am making a forums application in which when you press a button, the system date displays in a text box. I believe my code is right (it compiles without error), but when I press the button the wordTrue prints in the box instead of the date. Here is the code:

private: System::Void NewEntry_Click(System::Object^  sender, System::EventArgs^  e) {
			 time_t rawtime;
			 struct tm * timeinfo;
			 time ( &rawtime );
			 this->LogBox->Text = LogBox->Text + "\r\n" + Convert::ToString(ctime(&rawtime)) + ":";
		 }

Can anyone fix the code please :)

Running Visual C++ 2010.


Viewing all articles
Browse latest Browse all 15302


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>