Hi i am sort of a newbie to C++ and i made an encryption/decryption program. but theres one problem i cant reserve bytes of memory for a string. my code is:
string ES;
ES.reserve(1000);
and it gives the following errors
CrypterGUI.cpp(9): error C2143: syntax error : missing ';' before '.'
1>CrypterGUI.cpp(9): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>CrypterGUI.cpp(9): error C2371: 'ES' : redefinition; different basic types
1> CrypterGUI.cpp(8) : see declaration of 'ES'
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Crypter());
return 0;
}
using namespace std;
using namespace msclr::interop;
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Crypter
/// </summary>
public ref class Crypter : public System::Windows::Forms::Form
{
public:
Crypter(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Crypter()
{
if (components)
{
delete components;
}
}