Browse Source

Fix the spelling and example list code.

Aaron 2 years ago
parent
commit
81f1db2ca8
1 changed files with 10 additions and 9 deletions
  1. 10 9
      tutorials/scripting/gdscript/gdscript_advanced.rst

+ 10 - 9
tutorials/scripting/gdscript/gdscript_advanced.rst

@@ -322,23 +322,24 @@ Iterating using the C-style for loop in C-derived languages can be quite complex
 
 .. code-block:: cpp
 
-    const char* strings = new const char*[50];
+    const char** strings = new const char*[50];
 
     [..]
 
     for (int i = 0; i < 50; i++) {
-
-        printf("Value: %s\n", i, strings[i]);
-    }
+		printf("Value: %c Index: %d\n", strings[i], i);
+	}
 
     // Even in STL:
+    std::list<std::string> strings;
+    
+    [..]
 
-    for (std::list<std::string>::const_iterator it = strings.begin(); it != strings.end(); it++) {
-
-        std::cout << *it << std::endl;
-    }
+	for (std::string::const_iterator it = strings.begin(); it != strings.end(); it++) {
+		std::cout << *it << std::endl;
+	}
 
-Because of this, GDScript makes the opinonated decision to have a for-in loop over iterables instead:
+Because of this, GDScript makes the opinionated decision to have a for-in loop over iterables instead:
 
 ::