archang3l

Untitled

Oct 19th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char a1[100] = "Vom Eise befreite er die Windschutzscheibe";
  8.     char a2[100] = "Strom und Baeche";
  9.     char b1[100] = "Durch des Frueh";
  10.     char b2[100] = "lings und anderes";
  11.     char b3[100] = "holden, belebenden Blick";
  12.     char a[100];
  13.     char b[100];
  14.  
  15.     //Mit Funktionen der C-Bibliothek die ersten Zwei Zeilen erstellen
  16.   strncpy(a, a1, 16);
  17.   a[16] = '\0';
  18.   strcat(a, " sind ");
  19.   strcat(a, a2);
  20.   strcpy(b, b1);
  21.   strncat(b, b2, 6);
  22.   strcat(b, b3);
  23.     cout << a << endl;
  24.     cout << b << endl;
  25.     //Vom Eise befreit sind Strom und Baeche
  26.     //Durch des Fruehlings holden, belebenden Blick
  27.  
  28.     char c[10] = "123.45";
  29.     char d[10] = "12345";
  30.  
  31.     cout << c << endl;
  32.     cout << d << endl;
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment