Forum > Coding >

[RELEASE] C++ Simple Formatting!

Posts: 673

Threads: 30

Joined: Aug, 2020

Reputation: 6

Posted

I decided to release a utilized snprintf for formatting! this includes operator overloading! github

char buffer[2048] /* our max buffer length! you can change this if you want. */
#include "format.hpp"

void a(const char*);
void b(std::string)

int main() {
    format fmt("Hello %s\n", "World!");

    /* std::ostream overloading operator "<" */
    std::cout << fmt << ":)";

    a(fmt); // const char* overloading
    b(fmt)  // std::string overloading
    
    /*
    Hello World!
    */
}
  • 0

TERIHAX

i say im gay as a joke 🙀

Posts: 1789

Threads: 92

Joined: Jul, 2020

Reputation: 30

Replied

no idea wat this is bc im too retarded, but ill vouch anyways

  • 0

Posts: 0

Threads: 0

Joined: ?

Reputation:

Replied

I have no use for this right now but uhhh...I might need it some day? Idk. Vouch because maximus is cool.

  • 0

Posts: 166

Threads: 9

Joined: Feb, 2021

Reputation: 9

Replied

Idfk how this code works and what it used for 

 

But anyways vouch for Maximus bro 😩

  • 0

Im netral, not evil, not too kind either.

MINISHXP

minishxp

Posts: 813

Threads: 5

Joined: Jan, 2021

Reputation: 9

Replied

@TERIHAX this is just for formatting a string, something like you would do in c#:

int ballsize = 4783;
string res = String.Format("my balls are {0} big", ballsize); //my balls are 4783 big
  • 0

hi123

TERIHAX

i say im gay as a joke 🙀

Posts: 1789

Threads: 92

Joined: Jul, 2020

Reputation: 30

Replied

@MINISHXP ohh, but ur example is funny lmao, did you forget to put inches or smth

  • 0

MINISHXP

minishxp

Posts: 813

Threads: 5

Joined: Jan, 2021

Reputation: 9

Replied

@TERIHAX my balls take up 738378 meters of space (irl)

  • 0

hi123

Posts: 673

Threads: 30

Joined: Aug, 2020

Reputation: 6

Replied

like I said this is a string formatting, there's legit an example how it's being used.

  • 0

0x90

dingleberry#2286

vip

Posts: 223

Threads: 26

Joined: Dec, 2020

Reputation: 27

Replied

Ima be fr with you right. 

sprintf.

  • 0

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )