Saturday

gdb command to check the default ISO standard C++ year

Do the following steps.

Open command prompt window.
Compile program with -g flag to generate debug info
> g++ example.cpp -g

Debug program with gdb
> gdb a.exe

Put a breakpoint at main() function
(gdb) b main

Run program which will pause at breakpoint
(gdb) run

gdb information source
(gdb) info source
Output something like the following:
{
Current source file is example.cpp
Compilation directory is C:\Users\xxx\Desktop\cpp_directory
Located in C:\Users\xxx\Desktop\cpp_directory\example.cpp
Contains 21 lines.
Source language is c++.
Producer is GNU C++14 8.1.0 -mtune=core2 -march=nocona -g.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
}

(gdb) quit
>

No comments:

Measure execution time with Julia, example using sorting algorithms

# random integers between 1 and 100 inclusive, generate thousands of them x = rand ( 1 : 100 , 100000 ) @time sort (x; alg=InsertionSort, r...