Mass-replace tabs with 4-width spacing

This seems to be the predominant choice, and matches the last commit I
just made, so I went ahead and converted them all, and changed any, -
for example, 2-space indents.

Let me know if this is undesired.

To understand why I chose to do this, please refer to the previous
commit's message.
pull/99/head
terminalforlife 4 years ago
parent 4df5219c66
commit ade78aaafb

@ -26,4 +26,3 @@ int functionName(int &referenceName) {}
// Pass by value (the caller and callee have two independent variables with the same value)
int functionName(int valueName) {}

@ -1,8 +1,15 @@
int *int_Ptr; // Declare a pointer variable called iPtr pointing to an int (an int pointer)
// Declare a pointer variable called iPtr pointing to an int (an int pointer)
// It contains an address. That address holds an int value.
double *double_Ptr; // Declare a pointer of type double.
int *int_Ptr;
int a = 5; // Initializes a to the integer value 5
int *int_Ptr = &a // Set int_Ptr which is an int pointer to the address of a
std::cout << int_Ptr; // Returns the address of a
std::cout << *int_Ptr; // Returns 5 because it dereference the pointer to retrieve the value of a.
// Declare a pointer of type double.
double *double_Ptr;
// Initializes a to the integer value 5
int a = 5;
// Set int_Ptr which is an int pointer to the address of `a`.
int *int_Ptr = &a
// Returns the address of `a`.
std::cout << int_Ptr;
// Returns 5 because it dereference the pointer to retrieve the value of `a`.
std::cout << *int_Ptr;

@ -1,14 +1,24 @@
var a []int // declare a slice - similar to an array, but length is unspecified
var a = []int {1, 2, 3, 4} // declare and initialize a slice (backed by the array given implicitly)
a := []int{1, 2, 3, 4} // shorthand
chars := []string{0:"a", 2:"c", 1: "b"} // ["a", "b", "c"]
// declare a slice - similar to an array, but length is unspecified
var a []int
// declare and initialize a slice (backed by the array given implicitly)
var a = []int {1, 2, 3, 4}
// shorthand
a := []int{1, 2, 3, 4}
// ["a", "b", "c"]
chars := []string{0:"a", 2:"c", 1: "b"}
var b = a[lo:hi] // creates a slice (view of the array) from index lo to hi-1
var b = a[1:4] // slice from index 1 to 3
var b = a[:3] // missing low index implies 0
var b = a[3:] // missing high index implies len(a)
a = append(a,17,3) // append items to slice a
c := append(a,b...) // concatenate slices a and b
// creates a slice (view of the array) from index lo to hi-1
var b = a[lo:hi]
// slice from index 1 to 3
var b = a[1:4]
// missing low index implies 0
var b = a[:3]
// missing high index implies len(a)
var b = a[3:]
// append items to slice a
a = append(a,17,3)
// concatenate slices a and b
c := append(a,b...)
// create a slice with make
a = make([]byte, 5, 5) // first arg length, second capacity

@ -32,17 +32,17 @@ else:
# Basic 'for' loop:
for i in range(6):
print(i) #prints 0, 1, 2, 3, 4, 5
#
for i in range(2, 6):
print(i) #prints 2, 3, 4, 5
#
for i in range(3, 10, 2):
print(i) #prints 3, 5, 7, 9
# Iterating through collections:
for i in [0, 1, 1, 2, 3, 5]:
print(i) #prints 0, 1, 1, 2, 3, 5
#
for i in 'qwerty':
print(i) #prints q, w, e, r, t, y

Loading…
Cancel
Save