Hello Everyone.
I am creating this Windows Forms Application using Visual Studio.
Basically, in order to do what I want to do, I need to use an integer, and that integer needs to be converted into a string in order to change the label text, when pushing the button. However, using static_cast, like I did in the code below gives me " error C2061: syntax error : identifier 'string' ". :( I have included <string> on top of the file.
What shall I do in order to fix this problem and make this run? Any suggestions?
Thanks in advance. :)
#pragma once
#include <string>
namespace testingforms {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
///////////////////////////////////////
// Everything that is created by default
// when creating a Windows Forms Application
// I just deleted it, I don't think it is that much of a concern.
//////////////////////////////////////
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
int a;
a=5;
label2->Text = static_cast<string>(a); //right here
}
}