Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 15:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



C++ Class Definitions

Discussion on C++ Class Definitions within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
lolxdflyx3's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 331
Received Thanks: 65
C++ Class Definitions

Hallo,
ich sitzt vor nem Fehler und komm einfach nicht weiter. Mittlerweile denke ich schon fast, dass es am Compiler liegt

Hier sind 3 Versuche mit Errors:

Versuch 1:

Versuch 2:

Versuch 3:

Was mach ich falsch?

mfg lolxdfly
lolxdflyx3 is offline  
Old 04/04/2014, 12:07   #2
 
LcPlayer1's Avatar
 
elite*gold: 1765
Join Date: Aug 2011
Posts: 2,538
Received Thanks: 400
1. Versuch: Entferne die ganzen publics vor den Methodendeklarationen, die stehen ja schon im Publicbereich.

Alternative(wenn auch unnötig): hinter jedes public ein ":"

Edit: Vergiss meinen Beitrag, hab mir die anderen Versuche nicht angeschaut...
LcPlayer1 is offline  
Old 04/04/2014, 12:20   #3
 
Dr. Coxxy's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 1,206
Received Thanks: 736
hast die memberdefinitionen i-wo vor der deklaration oder vergessen den header in der cpp einzubinden.
Dr. Coxxy is offline  
Old 04/04/2014, 12:36   #4
 
lolxdflyx3's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 331
Received Thanks: 65
Quote:
Originally Posted by Dr. Coxxy View Post
hast die memberdefinitionen i-wo vor der deklaration oder vergessen den header in der cpp einzubinden.
der Header ist in der Cpp drinne!

Was genau meinst du mit
Quote:
Originally Posted by Dr. Coxxy View Post
hast die memberdefinitionen i-wo vor der deklaration
lolxdflyx3 is offline  
Old 04/04/2014, 12:40   #5
 
Dr. Coxxy's Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 1,206
Received Thanks: 736
bei versuch 3:

error C2653: 'CConsignmentMng' : is not a class or namespace name
error C2227: left of '->AddItem' must point to class/struct/union

er kennt offensichtlich an der stelle wo du CConsignmentMng->AddItem definierst noch nicht die CConsignmentMng klasse.
außerdem sollte man afaik bei nem singleton den destruktor public machen und noch den = operator private überladen.
Dr. Coxxy is offline  
Old 04/04/2014, 12:47   #6
 
Tyrar's Avatar
 
elite*gold: 0
Join Date: Oct 2008
Posts: 1,637
Received Thanks: 1,119
Jede Methode einzeln als public zu deklarieren ist nicht nötig.
Hinter der abschließenden Klammer sollte ein Semikolon stehen.
Nutzt nur die "Instance" Methode den Konstruktor? Zumindest erlaubst du dem Compiler nicht, den Konstruktor von woanders aufzurufen. Wobei das auch einen anderen Fehler verursachen würde, wie wird der genau aufgerufen?
Tyrar is offline  
Reply

Tags
c++, class, error


Similar Threads Similar Threads
[ENG] Error: Error 1 error C2601: 'HackMain' local function definitions are illegal
08/20/2013 - C/C++ - 1 Replies
So, as the title says I've been encountering an error Error 1 error C2601: 'HackMain' local function definitions are illegal I'm running on VC++ (Visual C++) This is my code: void HackMain() { for (;; ) { HackThread(); }
[Tool] Extract Protocol Message Definitions
09/15/2012 - DarkOrbit - 3 Replies
Here you go, everything is explained in the top comment. Does not work for Messages that contain arrays of others. /* This program will create struct definitions for Darkorbit protocol. * If you see "Attention Array" anywhere, you have to manualy work out that packet! * Beforehand you need to decompile the .swf . showmycode.com works great for that. * Point this program to the commands folder in ...\net\bigpoint\darkorbit\net\netty folder. */ using System; using...
[Tool] Extract Protocol Message Definitions 0.2
08/21/2012 - DarkOrbit - 13 Replies
Here is a quick rewrite of my client<->server messages extractor. It uses the output of as3sorcerer as input and outputs the messages in json. This json file you can then further parse to do whatever you like with it. Extract Protocol Message Definitions 0.2 - Pastebin.com Advantages of new version: - easier to read, because of python - better output - will support automatic id updating on changed id's in the future (for rev. 0.3)
Finde definitions zahl nicht
07/24/2010 - AutoIt - 2 Replies
Also das Script wurde von darter gekürzt nun finde ich aber die zahlen nicht mehr von den checkboxen die ich aber dringend bräuchte damit der bot weiß ob er den link aufrufen soll oder nicht. Wenn ihr noch fehler findet sagts pls. hier mein aktueller code. #include <String.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=C:\Users\Peter...



All times are GMT +1. The time now is 15:44.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.