Elina
Computer
- Jun 7, 2005
- 1
I have this code and I get this error messages, when I try to initialize mypointer:
E2238 Multiple declaration for 'identifier'
E2344 Earlier declaration of 'identifier'
E2141 Declaration syntax error
//---------------------------------------------------------
#include <vcl.h>
#include <stdlib.h>
#include <math.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
struct sar
{
int x;
int y;
int mgn;//magnitude
sar *nextpx;
sar *nextline;
};
sar *mypointer=new sar;
//compiler shows this is a wrong line
mypointer->mgn=9;
//---------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
struct sar
{
int x;
int y;
int mgn;//magnitude
sar *nextpx;
sar *nextline;
};
sar *n1=new sar;
n1->mgn=9;
}
//---------------------------------------------------------void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key)
{
exit(0);
}
//---------------------------------------------------------
E2238 Multiple declaration for 'identifier'
E2344 Earlier declaration of 'identifier'
E2141 Declaration syntax error
//---------------------------------------------------------
#include <vcl.h>
#include <stdlib.h>
#include <math.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
struct sar
{
int x;
int y;
int mgn;//magnitude
sar *nextpx;
sar *nextline;
};
sar *mypointer=new sar;
//compiler shows this is a wrong line
mypointer->mgn=9;
//---------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
struct sar
{
int x;
int y;
int mgn;//magnitude
sar *nextpx;
sar *nextline;
};
sar *n1=new sar;
n1->mgn=9;
}
//---------------------------------------------------------void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key)
{
exit(0);
}
//---------------------------------------------------------