Code & Transcript : Best C++ Book : In this tutorial we explore advanced uses …



  1. I came up with this for oddlist with help from your Lambda Functions Tutoarial:
    Looking forward to arduino electronics 🙂

    #include <functional>
    #include <vector>
    #include <cstdlib>

    void ChangeList(

    // Reference to source list
    const std::vector<short>& randomIntegerList,

    // Odd integers returned in here
    std::vector<short>& oddIntegerList,

    // Provide a function to perform Odd Number check
    const std::function<bool(short)> isItOdd)
    for(auto i: randomIntegerList)
    if( true == isItOdd(i) )

    int main()
    // This list will be modified directly by ChangeList()
    std::vector<short> oddList;

    // Lambda function passed in as the Odd Number checker
    // Odd numbers have a trailing '1' bit
    [](short n){ return n & 1; }

    // Print results
    printf("List of Odds: ");
    for(auto i: oddList) printf("%d ", i);
    printf("%c", 'n');
    return 0;

  2. Derek sir i want to ask something…that if i want to become specialist in website….then which things i should learn firstly so that i can manage my website… i need to know about coding and programming for this purpose??

  3. do you know something about……..
    HOW TO USE * gotoxy * in any c++ ide

    actually i am coding a program to print a diamond pattern but when i use this gotoxy() in atom ide it is asking to declare the scope……but i dont know how to declare the scope for gotoxy()…

    please help….

  4. I couldn’t believe that so many Computer Language Tutorials are made by yourself!! How could you learn so many languages??I only learnt C and C++,and I’m learning Python using my raspberrypi0w,and I’m planning to learn Assembly on ARM by watching your Assembly Tutorial videos. Nice Job!

  5. Very nice series of video tutorials Derek. I always wanted to see you do a series on C++. Great job. Can you please add one or two videos in this series about GUI development using C++ as well as files/directory operations and process management using C++ if you haven't already planned to do that? Many people want to learn those but most tutorials on the internet ignore those two topics, yet they are incredibly important topics. It'll be great if you included those two things. Thanks.

  6. Awesome tutorial, love the functional programming, I didn't know it was possible in C++ before watching your tutorials. Thank you!
    Second problem.

    #include <iostream>
    #include <vector>
    #include <functional>
    #include <cstdlib>
    #include <ctime>

    void FlipArr(std::function<int(int low, int high)> func);

    int Flip(int high, int low);

    int main() {
    return 0;

    void FlipArr(std::function<int(int low, int high)> func) {
    std::vector<bool> FlipArray(100);
    for (auto i : FlipArray)
    i = func(1, 0);
    int heads = 0, tails = 0;
    for (auto i : FlipArray)
    if (i)
    std::cout << "Number of heads : " << heads << std::endl;
    std::cout << "Number of tails : " << tails << std::endl;

    int Flip(int high, int low) {
    return rand() % (high – low + 1) + low;

    First problem, I actually gave the same vector elements as in your example before watching.

    #include <iostream>
    #include <vector>
    #include <functional>

    bool IsOdd(int num);

    std::vector<int> ListOfOdds(std::function<bool(int)> func, std::vector<int> myVec);

    int main()
    std::vector<int> oddArr, vecArr = { 1, 2, 3, 4, 5 };
    oddArr = ListOfOdds(IsOdd, vecArr);
    for (auto i : oddArr)
    std::cout << i << " ";
    return 0;

    bool IsOdd(int num) {
    return num % 2 != 0;

    std::vector<int> ListOfOdds(std::function<bool(int)> func, std::vector<int> myVec) {
    std::vector<int> OddArr;
    for (auto i : myVec)
    if (func(i))
    return OddArr;

  7. Head and tail counter:

    #include <iostream>
    #include <random>
    #include <ctime>
    #include <cstdint>

    int main()
    std::mt19937 engine{static_cast<std::uint_fast32_t>(std::time(0))};
    std::uniform_int_distribution<bool> distribution{false, true};

    std::int_fast16_t heads{0};
    for (std::intfast8_t i{0}; i != 100; ++i)
    if (distribution(engine))

    std::cout << "Number of Heads: " << heads << "nNumber of Tails: " << 100 – heads;

  8. I got the solution, sorry for disturbing. The problem was when two players clicks on start game at same time, they both read the request field empty and then writes on the field but one of the field got overwritten.

    I was just writing the expansion n then i got that I can simply put a rule on that the connection field can only be added or removed, it can't overwritten

  9. Thank you but actually my I'm making my app for both Web and Android. Here is the demo
    I wanted to do random opponent like in 8 Ball Pool.

    When a player clicks on start game, it first read the request field, if it is empty then it'll write its own id there and listen for it until it get deleted and when it gets delete, it connects itself to the very last created game.

    And if there is already an id there then it deletes that id and create a game using that as opponent.

  10. Mr. Derek there's something I have always wondered. Why do u produce so many video contents. So u are of those who believe that education should be free or u simply believe there's no need to go to college to learn to be a coder ?

  11. I'm making a multiplayer turn based game using Firebase kind of like Tic Tac Toe. I got two problems, first is creating a connection between two players (I've already done it but it's not that good) and security issue.
    Can you give me any idea about the establishing connection?


Please enter your comment!
Please enter your name here