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.

asdf234

User
  • Registriert

  • Letzter Besuch

Alle Beiträge von asdf234

  1. Schreiben Sie ein Programm, das einen positiven ganzzahligen Wert n ≥ 6 einliest. Anschließend reservieren Sie Speicher für ein Array TextSammlung von n Pointern auf die folgende Datenstruktur: struct TextBlock { char * Text; size_t Laenge; }; Lesen Sie nun n Texte beliebiger Längen ein (Leerzeichen in den Texten sollen erlaubt sein), und befüllen Sie die Datenstruktur entsprechend mit dem Text und seiner Länge. Geben Sie dann jeden Text und seine Länge mit cout übersichtlich formatiert aus. Vertauschen Sie im Anschluss die ersten 3 mit den letzten 3 Texten mit Hilfe einer geeigneten Funktion. Randbedingungen: 1) Die Verwendung der C++-Klasse string ist nicht erlaubt. 2) Verwenden Sie nur new zur Speicherallokation, nicht malloc()! 3) Vertauschen heißt nicht Kopieren... Das ist die komplette Angabe. Meine Unterlagen sind leider nicht besonders gut.
  2. Danke für die Antwort. Ja das soll ein Array aus Textfeldern sein. Das das Int einBlödsinn ist sehe ich ein. Ich weis eben nicht wie ich "TextFeld" definiere.
  3. Liebes Forum, Das Programm soll eine ganze Zahl n einlesen, und anschließend n Text in einer Strucktur speichern und ausgeben. In der Form: struct TextBlock { char * Text; size_t Laenge; }; Ich habe bisher: #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iomanip> using namespace std; int main(int argc, char* argv[]) { unsigned int count = 0; std::cin >> count; int TextFeld ** array = new TextFeld*[count]; if(array == nullptr) return -1; for(size_t i = 0; i < count; ++i) { array = new TextFeld(); char* tmp = nullptr; scanf("%ms[^\n]", &tmp); array->text = tmp; array->len = strlen(tmp); } for(size_t i = 0; i < count; ++i) { std::cout << std::setw(5) << array->len << ": " << array->text << std::endl; } for(size_t i = 0; i < count; ++i) delete array; delete[] array; } struct TextFeldMod : public TextFeld { TextFeldMod() { text = nullptr; len = 0; } ~TextFeldMod() { free(text); } }; Das Programm läuft nicht. Ich bin mir nicht sicher wie ich die Variablen richtig deklariere. z.b. TextFeld Ich bin mit meinem Wissem am Ende angelangt. Bin für jeden Lösungsvorschlag oder Hilfe sehr Dankbar!

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.