variables Feld?

Code:
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
	int size;

	cin >> size;

	char* array = new char[size];

	for (int i=0; i<size; ++i){
		array[i] = 'a';
		cout << array[i] << endl;
	}
	return 0;
}
Zuerst gibst du hier eine Grösse ein.. Dann wird das Array mit der Grösse erstellt..
 
Hallo Denver1,
ich würde CString benutzen.

CString str="";

str="hajhdjhuzweruzu";
str="hfdhfhj";
str="fhzauirezwzeriwsfdiudsfudsiofuioweiu";

hat keine Längenbegrenzung und hat noch ein paar Extras wie:
Format,GetAt,GetLength usw.

Viel Spass damit,
bye.
 
Zurück