C++ Strings #include using namespace std; string bla; bla = "text"; bla = "this" + " is a " + "text!"; if (bla == "blup") ... cout << bla.size(); cout << bla.find("x"); C-String char cs[20] = "hello"; // CAN only assign in initialization!!!! cs = "bla"; // DOES NOT WORK! cout << cs + "something else" // DOES NOT WORK if (cs == "bla") // DOES NOT WORK cout << cs; // does work char xxx[100]; char bla[100] = "this is a test"; for (int i=0;bla[i]!='\0';i++) { cout << bla[i] << " "; } alternative for bla[i]!='\0' bla[i] != 0 bla[i] #include // int strcmp(char a[], bla b[]) char a[5] = "bla"; char b[6] = "blup"; if ( strcmp(a,b) == 0) // compares a and b for equality strcpy(b,a); // would be b=a; strcat(b,a); // would be b = b+a; strncpy(b,a,5); // safe version of strcpy cin >> b; // cout << static_cast(toupper(a[1])); // toupper is in ask the user for an input read in a c-string while the end of the string is not reached print the upper case version of the character at the current index cin >> bla[100]; // WRONG: This tries to input 1 character into index 100