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.

arrays

Empfohlene Antworten

Veröffentlicht

Moin,

der zeigt mir immer folgendes kompilierungsprob an:


1>c:\users\sebastian\documents\visual studio 2008\projects\bsgdt\bsgdt\main.cpp(43) : error C2440: 'Initialisierung': 'int' kann nicht in 'int [10]' konvertiert werden

1>        Es gibt keine Konvertierungen von Arraytypen, obwohl es Konvertierungen von Verweisen oder Zeigern in Arrays gibt

hier ist der code an der stelle:
int main(void)

{

	int gbet,gwin,nbet,lbet,nwin,sbet,x,y,irand,zahl,rounds,irounds,maxbet,ent,lrounds,anz[10]=0;

	bool win;

was mache ich da falsch?

Du versuchst, ein int-Array mit einem einzelnen int-Wert (0) zu initialisieren. Das geht nicht.

Ich hoffe übrigens, du erwartest nicht, dass dieser Code die ganzen int-Variablen alle mit 0 initialisiert. Das passiert nämlich nicht. Initialisiert wird hier nur anz, und da passt wie gesagt der Typ des Initialisierungsausdrucks nicht.

Und noch eins: In C++ ist es eigentlich üblich, Variablen erst dort zu deklarieren, wo sie gebraucht werden, nicht alle auf einmal am Anfang wie in C.

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.