Programming Languages
0/6 sections
0%

C++

C++ is a powerful multi-paradigm language extending C with classes, templates, and the STL. It delivers C-level performance with high-level abstractions, powering game engines, compilers, databases, and financial systems.

Relevant to My Experience

How this topic connects to real projects and companies

Experience

C++ for performance-critical systems

Related Projects

1C++ vs C Key Additions

cpp
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() { // References (unlike C pointers must bind, can't be null) int x = 42; int& ref = x; ref = 100; // modifies x cout << x; // 100

// std::string (much safer than char arrays) string name = "Sufi"; name += " Sulaiman"; cout << name.length() << " " << name.substr(0, 4) << endl;

// std::vector (dynamic array) vector nums = {1, 2, 3, 4, 5}; nums.push_back(6); for (int n : nums) cout << n << " "; // range-based for

// nullptr (type-safe null pointer, replaces NULL) int* ptr = nullptr;

return 0; } ```

2Classes & OOP

cpp
#include <iostream>
#include <string>
using namespace std;

class BankAccount { private: string owner; double balance; static int count; // class-level variable

public: // Constructor BankAccount(string owner, double initial = 0.0) : owner(owner), balance(initial) { count++; }

// Destructor ~BankAccount() { count--; }

// Methods void deposit(double amount) { balance += amount; } bool withdraw(double amount) { if (amount > balance) return false; balance -= amount; return true; }

double getBalance() const { return balance; } // const method static int getCount() { return count; }

// Operator overloading BankAccount operator+(const BankAccount& other) const { return BankAccount(owner + "+" + other.owner, balance + other.balance); }

friend ostream& operator<<(ostream& os, const BankAccount& acc) { return os << acc.owner << ": $" << acc.balance; } };

int BankAccount::count = 0; ```

3Templates & Generic Programming

cpp
#include <vector>
#include <algorithm>

// Function template template T max_val(T a, T b) { return (a > b) ? a : b; }

// Class template template class Stack { private: T data[Size]; int top = -1; public: void push(T val) { data[++top] = val; } T pop() { return data[top--]; } bool empty() const { return top == -1; } };

// Template specialization template<> const char* max_val(const char* a, const char* b) { return strcmp(a, b) > 0 ? a : b; }

// Variadic templates (C++11+) template auto sum(Args... args) { return (args + ...); // fold expression }

// Usage Stack intStack; intStack.push(42); auto result = sum(1, 2, 3, 4, 5); // 15 ```

4Modern C++ (11/14/17/20)

cpp
#include <memory>
#include <optional>
#include <variant>
#include <functional>

// Smart pointers automatic memory management auto ptr = make_unique(42); // unique ownership auto shared = make_shared("hello"); // shared ownership // No manual delete needed!

// Lambda expressions auto square = [](int x) { return x * x; }; auto adder = [](int n) { return [n](int x) { return x + n; }; }; auto add5 = adder(5); // captures n=5

// std::optional may or may not have a value optional findUser(int id) { if (id == 1) return "Sufi"; return nullopt; } if (auto user = findUser(1)) cout << *user;

// std::variant type-safe union variant v = "hello"; if (holds_alternative(v)) cout << get(v);

// Structured bindings (C++17) auto [x, y] = make_pair(10, 20); map m = {{"a",1},{"b",2}}; for (auto& [key, val] : m) cout << key << "=" << val; ```

5STL Containers & Algorithms

cpp
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <algorithm>
#include <numeric>

vector v = {5,3,1,4,2}; sort(v.begin(), v.end()); // [1,2,3,4,5] reverse(v.begin(), v.end()); // [5,4,3,2,1] auto it = find(v.begin(), v.end(), 3); bool has3 = it != v.end(); int sum = accumulate(v.begin(), v.end(), 0); // 15

// Transform vector squared(v.size()); transform(v.begin(), v.end(), squared.begin(), [](int x){ return x*x; });

// map (sorted key-value) map scores = {{"Alice", 95}, {"Bob", 87}}; scores["Charlie"] = 91; for (auto& [name, score] : scores) cout << name << ": " << score << " ";

// unordered_map (O(1) average lookup) unordered_map freq; for (string& word : words) freq[word]++; ```

6Concurrency & Performance

cpp
#include <thread>
#include <mutex>
#include <future>
#include <atomic>

// Threads void worker(int id) { cout << "Thread " << id << " "; } vector threads; for (int i = 0; i < 4; i++) threads.emplace_back(worker, i); for (auto& t : threads) t.join();

// Mutex for shared state mutex mtx; int counter = 0; void increment() { lock_guard lock(mtx); // RAII auto unlock counter++; }

// std::async / future auto future = async(launch::async, []{ return heavyComputation(); }); // ... do other work ... auto result = future.get(); // blocks until ready

// Atomic operations lock-free atomic atomic_counter = 0; atomic_counter.fetch_add(1, memory_order_relaxed);

// Move semantics avoid expensive copies string makeString() { return "big string"; } string s = makeString(); // move, not copy ```

Explore the Full Portfolio

This is the complete portfolio of Sufi Khan Sulaiman, a technology leader specialising in B2B commerce and digital automation. Start from the Home page for the overview, then move through two decades of career experience across FLIR Systems, Lorex Technology, and 1c Platform, and the full catalogue of project case studies spanning headless commerce migrations, AI recommendation engines, and multi-channel fulfilment systems.

The skills and certifications page maps the technical and leadership capabilities behind the work, while the articles and the knowledge base break down the thinking into actionable frameworks. For hands-on learning, the tutorials and applications sections cover practical builds from front-end fundamentals to full-stack web apps.

For consulting engagement, the expertise page outlines service offerings, the ecommerce hub covers platform architecture and automation strategy, and the ecommerce guide (PDF) is a downloadable 55-page field manual. When you are ready to talk, the contact page is the direct line.