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.

namespace ... was das?!

Empfohlene Antworten

Veröffentlicht

Hallöle,

kann mir mal jemand verraten, was folgende Anweisung tut:

using namespace std;

Wozu brauch ich das? Was macht das?

namespaces sind ein weiterer Weg, in C++ Namenskonflikte zu vermeiden.

stell dir vor, in einem großen Projekt schreibt P1 eine Funktion tuwas und P2 tut das auch. Jetzt ist natürlich nicht klar, welche der beiden gemeint ist, wenn man tuwas() aufruft...

Also kann P1 schreiben:

namespace p1

{

void tuwas()...

}

und dann ist klar, daß ein Aufruf der Form entweder

p1::tuwas();

oder

using namespace p1;

tuwas();

die tuwas() von P1 aufruft. In C++ sind viele Dinge im namespace std definiert, damit klar ist, daß es sich um Standard-Sprachmerkmale handelt.

Du kannst die using-Direktive auch weglassen und stattdessen den namespace immer mit angeben :

std::cout << "hihi" << std::endl;

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.