Tag: Tutorial
std::generate Tutorial and example
In this article we will see how to use std::generate and std::generate_n with STL sequential containers. std::generate is a STL algorithm useful in generating data for a sequential container by calling passed function object continuously. For example, Advertisements Suppose, we have a structure Task and a std::vector<Task * > and we want to initialize this …
std::bind – Tutorial and Examples
In this article we will see how to use std::bind and when to use. std::bind std::bind is a Standard Function Objects that acts as a Functional Adaptor i.e. it takes a function as input and returns a new function Object as an output with with one or more of the arguments of passed function bound …
C++11 ‘auto’ Tutorial and Examples
In this article we will learn how to use auto variable in C++11. auto is introduces in C++11. With auto we can declare a variable without specifying its type. Its type will be deduced by the data to which its initializing i.e. // Storing a int inside a auto variable auto var_1 = 5; // …
Java Constructor Tutorial – Why do we need Constructors ?
In this article we will discuss need and usage details of constructors in Java. What is a Constructor ? Constructor is a member function of the class that is used to initialize a newly constructed object i.e. initializing the member variables of object. Advertisements It has the same name as of the class. Why do …
Java Constructor Tutorial – Why do we need Constructors ?Read More
Compiling C++ with Debug Symbols – gdb debugger Tutorial & Examples
In this article we will discuss how to build a C++ / C code in debug mode and how to start the debugging using gdb. Compile Code with Debug Symbols To debug a C or C++ application with gdb, it should be built in debug mode. So that debug symbols can be loaded and used …
Compiling C++ with Debug Symbols – gdb debugger Tutorial & ExamplesRead More
Breakpoints and Backtrace traversal – gdb debugger Tutorial & Examples
In this article we will discuss how to use breakpoints in gdb and check backtrace etc. How to add breakpoints in gdb Breakpoints can be added only at “gdb” prompt i.e. (gdb) To add a breakpoint in running application just press the “Ctrl-C” command to get the “gdb prompt back. Otherwise you can also add …
Breakpoints and Backtrace traversal – gdb debugger Tutorial & ExamplesRead More
Conditional Breakpoints and watchpoints | gdb debugger Tutorial and examples
Conditional Breakpoints Adding a simple breakpoint at a line will stop the running programming whenever that line of code is hit. But this might not be the requirement every time. Suppose we want to add a kind of breakpoint on a line that will get hit only when a condition is met, not always. Let’s …
Conditional Breakpoints and watchpoints | gdb debugger Tutorial and examplesRead More
Remote Debugging Tutorial using gdb Debugger
In This article we will discuss, how to do remote debugging a C++ application using gdb debugger. What is Remote Debugging Remote Debugging allows the application to run on a Target machine and user can debug it on a Host Machine. Advertisements [showads ad=inside_post] Frequently Asked: How to attach gdb with running process Debugging …
STL Algorithm – std::sort Tutorial and Example
In this article we will discuss STL Algorithm std::sort algorithm. std::sort is a STL Algorithm which provides the functionality of sorting a given range of elements. To use std::sort we need to pass start and end of range in it as an argument i.e. Advertisements std::sort (<START OF RANGE> , <END OF RANGE>); For example, we …
Process Identification in Linux – Tutorial & Example
In this article we will discuss, how to differentiate and identify each process in linux. Process ID Each process in Linux has a unique id and has a parent. We can get the process id of a running process and its parent’s process id using following functions, Advertisements pid_t getpid() pid_t getppid() File to be …
Process Identification in Linux – Tutorial & ExampleRead More