Advertisement

05.05.2008 at 01:14PM PDT, ID: 23377616 | Points: 500
[x]
Attachment Details
error C2061 in my code
Tags: C++
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(159) : warning C4183: 'Doarc01': member function definition looks like
a ctor, but name does not match enclosing class
gisp.cpp(181) : error C2061: syntax error : identifier '__Doarc01__mod_code'
gisp.cpp(1473) : 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 :



CODE
#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;
}
}
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: tetoo
Question Asked On: 05.05.2008
Participating Experts: 2
Points: 500
Views: 0
Translate:
Loading Advertisement...
05.06.2008 at 03:36AM PDT, ID: 21506074

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 05:33AM PDT, ID: 21506651

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.07.2008 at 08:08AM PDT, ID: 21517218

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
05.06.2008 at 03:36AM PDT, ID: 21506074
I'm not sure I completely follow what your problem is here. Can you post a full code rather than snippets?

Incidentally, you cannot define an array in this manner...

int n[5][5] = 0;

Try this...

int n[5][5] = {0};

* Notice the curly braces.
 
05.06.2008 at 05:33AM PDT, ID: 21506651

Rank: Guru

you have problem with the braces. If you don't indent the code correctly, you will suffer this problem every day.
 
05.07.2008 at 08:08AM PDT, ID: 21517218
dont know I ll see what can I do and get back to you guys thanks 4 now
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628