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.

Initialisierung von Struct mit CString

Empfohlene Antworten

Veröffentlicht

Das wird problemlos kompiliert:

struct structInfo{

int num1;

int num2;

int num3;

int num4;

_TCHAR name1[260];

_TCHAR name2[260];

_TCHAR name3[260];

};

static struct structInfo myGlobalInfos[] =

{

{1 , 2, 3, 4, _T("text1"), _T("text2"), _T("text3")},

{4 ,5, 6, 7, _T("text4"), _T("text5"), _T("text6")},

{8 ,15, 56, 97, _T("text7"), _T("text8"), _T("text9")}

};

---------------------TCHAR name3[260] --> CString name3----------

struct structInfo{

int num1;

int num2;

int num3;

int num4;

_TCHAR name1[260];

_TCHAR name2[260];

CString name3;

};

Das wird auch von VC 8.0.50 problemlos kompiliert.

VC 7.0.9466 gibt allerdings folgende Fehlermeldung aus:

error C2440: 'initializing' : cannot convert from 'int' to 'structInfo

No constructor could take the source type, or constructor overload resolution was ambiguous

Weißt jemand warum?

Danke im voraus

Visual Studio 7.1.6030 (Compilerversion 13.10.6030) kompiliert das.

Hast du das Service Pack für VS.NET 2003 installiert?

Danke für die Info.

Leider brauche ich das Kompilat von 7.0 und darf deshalb kein Service Pack installieren!

Moment, 7.0 ist VC++.NET 2002, 7.1 ist 2003, das hat mit Service Packs gar nichts zu tun.

Der 7.0-Compiler hat gegenüber dem 6.0 keine großen Fortschritte gemacht. Der große Sprung kam von 7.0 auf 7.1. Der Compiler ist also noch ziemlich weit vom Standard entfernt. Dein Problem beruht anscheinend auf einem Bug des Compilers.

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.