← Back to list

How To Make Your Own Beginner C/C++ Library. (Part 2)

Now That You’ve Learned The Basics, Lets Make Some Of The std::cout Thing But For Your Own.

Palittlestudios · 2025-05-29 11:47 · 0 claps · 0.4 min read
#cpp #header-file
Open on Medium ↗
Wiki topics: 📚 · Books & Reading

How To Make Your Own Beginner C/C++ Library. (Part 2)

Now That You’ve Learned The Basics, Lets Make Some Of The std::cout Thing But For Your Own.

#ifndef TEST_H // It Has To Be First
#define TEST_H

#include <iostream>
#include <conio.h> // Both Of These Are For The Loop
#include <windows.h> 

namespace pal {
    // The Printing
    void print(const std::string &text) {
        std::cout << text;
    }

    void loop() {
        while (!_kbhit()) {
            Sleep(1000);
        }
    }
}

#endif TEST_H_IMPLEMENTATION

And Then The Main File’s Code:

#include <test.h>

int main() {
    pal::print("Hello, World!");
    pal::loop();
    return 0;
}

And This Was Part 2. I Hope You Enjoy :)


메타데이터
post_id
a73eafcd2cc9
slug
how-to-make-your-own-beginner-c-c-library-part-2-a73eafcd2cc9
url
https://medium.com/@palittlestudios/how-to-make-your-own-beginner-c-c-library-part-2-a73eafcd2cc9
canonical_url
https://medium.com/@palittlestudios/how-to-make-your-own-beginner-c-c-library-part-2-a73eafcd2cc9
author_url
https://medium.com/@palittlestudios
status
ok
fetched_at
2026-07-08 08:18:29