diff --git a/wiki/cpp-tutorial/debugging-gdb.md b/wiki/cpp-tutorial/debugging-gdb.md index 6b28ad3..e317c2d 100644 --- a/wiki/cpp-tutorial/debugging-gdb.md +++ b/wiki/cpp-tutorial/debugging-gdb.md @@ -80,7 +80,7 @@ gdb program - `run, r` - start the program execution inside of gdb - `start` - creates a temporary breakpoint at `main()` and start execution -### Launch the executable and step thru the program +### Launch the executable and step through the program - `next, n` - executes the next line of code - `nexti, ni` - executes the next instruction @@ -108,7 +108,7 @@ Lets start with the obligatory hello world example: ```cpp:line-numbers #include int main() { - std::cout << "Hello, GDB!"; + std::cout << "Hello, GDB!" << std::endl; return 0; /* break here */ } ``` @@ -130,7 +130,7 @@ program `start`: Temporary breakpoint 1 at 0x123456: file main.cpp, line 3. Starting program: /file/path/to/main.out -Temporary breakpoint 1, main () at main1.cpp:3 +Temporary breakpoint 1, main () at main.cpp:3 3 std::cout << "Hello, GDB!" << std::endl; ``` diff --git a/wiki/cpp-tutorial/debugging.md b/wiki/cpp-tutorial/debugging.md index 7ac3b14..46f09fd 100644 --- a/wiki/cpp-tutorial/debugging.md +++ b/wiki/cpp-tutorial/debugging.md @@ -45,7 +45,7 @@ test for different scenarios. Main features of a debugger are: - Examining the suspended program - Examining the call stack - Inspecting memory -- Stepping trough the program +- Stepping through the program - Examine core dump files - Modifying the state of the program diff --git a/wiki/cpp-tutorial/language-basics.md b/wiki/cpp-tutorial/language-basics.md index a4778ec..c53530d 100644 --- a/wiki/cpp-tutorial/language-basics.md +++ b/wiki/cpp-tutorial/language-basics.md @@ -81,7 +81,7 @@ int foo = 0; // declaration statement foo = foo + 2; // expression statement ``` -The above snippet creates `foo` with an initial value of `1`, then evaluates `foo + 2` before assigning the value back +The above snippet creates `foo` with an initial value of `0`, then evaluates `foo + 2` before assigning the value back to the variable `foo`. ## Identifiers @@ -294,7 +294,7 @@ together and write a simple program that changes Fahrenheit to Celsius. The equation to convert the two is very simple: $C = (F - 32) / (9 / 5)$. -Because temperature is not a integer value, but a real number, we will use `double` to store our variables. +Because temperature is not an integer value, but a real number, we will use `double` to store our variables. ```cpp int main() {