Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hi,

Ich kann auf Klassen nicht zugreifen, da mein Debugger sie nicht erkennt. (Ich benutze Microsoft Visual C++).

Ich habe folgende Klasse:


class addition 

{

public:

	int ergebnis;

	addition(int a, int 

	{

		 this->ergebnis = a + b;

	}

};

[/code]




So will ich auf diese Klasse zugreifen:

[CODE]addition *add = new addition(12,45);

"Mein" Debugger

1>.\konsole.cpp(11) : error C2065: 'addition': nichtdeklarierter Bezeichner

1>.\konsole.cpp(11) : error C2065: 'add': nichtdeklarierter Bezeichner

1>.\konsole.cpp(11) : error C2061: Syntaxfehler: Bezeichner 'addition'

Ich hoffe, ihr könnt mir helfen

Mit freundlichen Grüßen

mustiwebp

selber namespace? wenn nicht, den namespace, in dem sich die klasse addition befindet, eingebunden?

und nebenbei würde ich klassennamen immer mit großbuchstaben beginnen: Addition

Bearbeitet von 0815FIA

So will ich auf diese Klasse zugreifen:

addition *add = new addition(12,45);

In welchem Kontext steht dieser Code denn? Was steht drumherum?

und nebenbei würde ich klassennamen immer mit großbuchstaben beginnen: Addition

Bei solchen Ratschlägen bitte auch immer eine Begründung mitliefern. Und wenn es nur eine persönliche Vorliebe ist.

  • Autor

Hi,

Also, der gesamte Quellcode lautet:


#include "stdafx.h"


using namespace System;


int main(array<System::String ^> ^args)

{

    Console::WriteLine(L"Hello World");

    return 0;

    addition *add = new addition(12,45);

}


class addition 

{

public:

	int ergebnis;

	addition(int a, int 

	{

		 this->ergebnis = a + b;

	}

};

[/code]

Mit freundlichen Grüßen

mustiwebp

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.