Codeschnippseln für diese Übung

Dependencies:   mbed

Revision:
2:7a0bae2281e8
Parent:
1:c65875995efb
diff -r c65875995efb -r 7a0bae2281e8 class4.cpp
--- a/class4.cpp	Tue Oct 13 16:34:21 2020 +0000
+++ b/class4.cpp	Tue Oct 13 16:45:15 2020 +0000
@@ -29,13 +29,18 @@
             pc->printf("Auflistung beendet!\n\n");
         }
         
-        void PrintString(char *str, int count)
+        void PrintString(char *str)
         {
             pc->printf("String: ");
+            int i = 0;
             
-            for (int i = 0; i < count; i++)
+            while(true)
             {
+                if (str[i] == '\0')
+                    break;
+                    
                 pc->putc(str[i]);
+                i++;
             }
             
             pc->printf("\n");