Advertisement

05.05.2008 at 01:27PM PDT, ID: 23377675
[x]
Attachment Details

error C2061

Asked by tetoo in C++ Programming Language

the problem in C++ code after I add class network32.

Im using OMNET++ network simulator with V.6 service back 6 my code was working perfectly but I had to add another class which is class network32 then I start getting those errors I dont know what I should do


Im having those errors and couldnt solve them any help pls .. I used to have this kind of error C2258: illegal pure syntax, must be '= 0' till I moved this part of my code

CODE
int Doarc01::connection[100][100]=0;
int Doarc01::newarray[100][100]=0;
int Doarc01::pos[100]=0;
int Doarc01::ConnCounter=0;
int Doarc01::numoflinks=0;
double Doarc01::credit1[100][100]=5;
double Doarc01::credit2[100][100]=5;
double Doarc01::credit3[100][100]=5;
double Doarc01::credit4[100][100]=5;
double Doarc01::credit5[100][100]=5;
double Doarc01::residualBandwidth[100][100]=150;
double Doarc01::RejCon=0;
double Doarc01::BP=0;
double Doarc01::totalBlockedBandwidth=0;
double Doarc01::totalCarriedBandwidth=0;
double Doarc01::meanServiceTime=83.468;

inside the class but I dont know if what i did is correct it reduce the errors and the errors that Im having now is

gisp.cpp(149) : warning C4183: 'Doarc01': member function definition looks like
a ctor, but name does not match enclosing class
gisp.cpp(152) : error C2061: syntax error : identifier '__Doarc01__mod_code'
gisp.cpp(1444) : fatal error C1004: unexpected end of file found
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
and this is the final draft which gave me the previous errors now :



Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <math.h>
#include <string.h>
#include <omnetpp.h>
#include <fstream.h>
#include "packet_m.h"
 
#define TIMER_CONNECTION_REQUEST -1
#define PKT_FORWARD               0
#define PKT_FAIL                  1
#define PKT_SUCCES                2
#define TIMER_CONN_RELEASE        3
#define interarrival              1 
#define candidate_pathnumber      4
#define windowsize                20
#define min_BW                    0.1
#define max_BW                    2
 
class Doarc01 : public cSimpleModule
{
protected:
 
static int connection[100][100];
static int newarray[100][100];
static int pos[100];
static double RejCon;
static int ConnCounter,numoflinks;
static double totalBlockedBandwidth;
static double connectionRequest;
static double BP;
static double totalCarriedBandwidth,meanServiceTime;//windowsize
static double credit1[100][100],credit2[100][100],credit3[100][100],credit4[100][100],credit5[100][100];
static double residualBandwidth[100][100];
int pinX1[33];
int pinY1[33];
int NumNode;
int dimx;
int dimy;
int edgeDgree ;
double alpha;
double beta;
int Kscail;
int set[500],pathestimate[500],visited[100],predecessor[100],path[100],candidatepath[20][20];
 
int destination;
int final_index;
 
 
class network32
{
	int window1[windowsize];
	int window2[windowsize];
	int window3[windowsize];
	int window4[windowsize];
	
public:
	network32()
	{
        
		for(int i=0;i<windowsize;i++)
		{
		window1[i]=0;
		window2[i]=0;
		window3[i]=0;
		window4[i]=0;
		}
	}
 
	void shift(int value)
	{
     
	 if(final_index==0)
	 {
		 for(int q=0;q<windowsize-1;q++)
		 {
			 window1[i]=window1[i+1];
			 window1[windowsize]=value;
		 }
	 }
	
	 else if(final_index==1)
	 {
		 for(int q=0;q<windowsize-1;q++)
		 {
			 
			 window2[i]=window2[i+1];
			 window2[windowsize]=value;
		 }
	 }
	 else if(final_index==2)
	 {
		 for(int q=0;q<windowsize-1;q++)
		 {
			 window3[i]=window3[i+1];
			 window3[windowsize]=value;
		 }
	 }
 
	 else if(final_index==3)
	 {
		 for(int q=0;q<windowsize-1;q++)
		 {
			 window4[i]=window4[i+1];
			window4[windowsize]=value;
		 }
	 }
 
};
 
cMessage *generateConReq;
 
public:
 
	Doarc01()
	{    
		virtual void initialize();
		virtual void handleMessage(cMessage *msg);
        void random_node();
		void sort(int pinXY[100][2]);
        void randomEdge();
		int dijkstra(int source, int destination);
		void printpath(int x,int i,int p[],int b[],int cc);
		int minimum(int a[],int m[]);
		void Generate();
		void candidatePath1(int source, int destination);
		void load();
		int calMinHop();
		int dijkstra2(int source, int destination);
		//////////////////////////////////////////////////////////////////////////////////////////////////////
        int Doarc01::connection[100][100]=0;
		int Doarc01::newarray[100][100]=0;
		int Doarc01::pos[100]=0;
		int Doarc01::ConnCounter=0;
		int Doarc01::numoflinks=0;
		double Doarc01::credit1[100][100]=5;
		double Doarc01::credit2[100][100]=5;
		double Doarc01::credit3[100][100]=5;
		double Doarc01::credit4[100][100]=5;
		double Doarc01::credit5[100][100]=5;
		double Doarc01::residualBandwidth[100][100]=150;
		double Doarc01::RejCon=0;
		double Doarc01::BP=0;
		double Doarc01::totalBlockedBandwidth=0;
		double Doarc01::totalCarriedBandwidth=0;
		double Doarc01::meanServiceTime=83.468; 		
		//////////////////////////////////////////////////////////////////////////////////////////////////////		
	}	 
};
 
Define_Module(Doarc01);
Doarc01::Doarc01()
{
       for(int i=1;i<100;i++)
		for(int j=1;j<100;j++)
		{
			Doarc01::connection[i][j]=0;
            Doarc01::newarray[i][j]=0;
			Doarc01::credit1[i][j]=5;
			Doarc01::credit2[i][j]=5;
			Doarc01::credit3[i][j]=5;
			Doarc01::credit4[i][j]=5;
			Doarc01::credit5[i][j]=5;
			Doarc01::residualBandwidth[i][j]=150;
		}
		
       for( i=0;i<100;i++)
		Doarc01::pos[i]=0;
}
[+][-]05.05.2008 at 01:40PM PDT, ID: 21502827

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 01:54PM PDT, ID: 21502916

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 02:01PM PDT, ID: 21502972

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 02:02PM PDT, ID: 21502977

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 02:14PM PDT, ID: 21503062

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 02:24PM PDT, ID: 21503148

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.05.2008 at 03:02PM PDT, ID: 21503383

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 03:24PM PDT, ID: 21503518

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C++ Programming Language
Sign Up Now!
Solution Provided By: tetoo
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628