You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, March 5th 2007, 8:03pm

[Borland] String in Array

Hallo.
Hab n kleines Problem mit C++. Wie kann man in nem Array Strings festlegen? Mit

C Quellcode

1
string artist[5] = {"eminem","50 cent","bushido","savas","jin"};


gehts anscheinend nicht. Und bei der Fehlermeldung steig ich auch nich durch.

//edit

Habs :)

C Quellcode

1
String artist[5] = {"eminem","50 cent","bushido","savas","jin"};


Trotzdam danke!

2

Tuesday, March 6th 2007, 11:55am

Wenn du es mit Standard C++ machen willst (string != String), muss du erst das array anlegen und dann die Elemente befüllen.
Oder du nimmst einen vector<string> um eine dynamische Anzahl von Elementen in die Liste einzufügen.

Similar threads

Social bookmarks