Minh Nguyen / Misc

Files at this revision

API Documentation at this revision

Comitter:
khaiminhvn
Date:
Thu Mar 25 01:05:14 2021 +0000
Parent:
3:a1a820da71f6
Commit message:
Added blank() function

Changed in this revision

Misc.cpp Show annotated file Show diff for this revision Revisions of this file
Misc.h Show annotated file Show diff for this revision Revisions of this file
--- a/Misc.cpp	Tue Mar 23 21:21:11 2021 +0000
+++ b/Misc.cpp	Thu Mar 25 01:05:14 2021 +0000
@@ -38,6 +38,14 @@
     return tmp;
 }
 
+//blank
+string Misc::blank(int n){
+    string out = "";
+    for(int i = 0; i < n; i++)
+        out += " ";
+    return out;
+}
+
 //fill
 void Misc::fill(int *arr, int val, int size){
     for(int i = 0; i < size; i++)
--- a/Misc.h	Tue Mar 23 21:21:11 2021 +0000
+++ b/Misc.h	Thu Mar 25 01:05:14 2021 +0000
@@ -11,6 +11,7 @@
     static string itos(int n, int w);
     static string itos(float n);
     static string itos(float n, int w);
+    static string blank(int n);
     static void fill(int *arr, int val, int size);
 };