There are lots of "2d-barcode" codes -- there's a list here:
What exactly are you interested in learning about?
How the data is encoded/decoded? Or to actually create the image or print the bar code?
If you want to know about the encoding/decoding, then look up the particular code you are interested in.
If it's QR code, then it's explained well here:
If you want to know how to know how to create the image or printer commands to generate it, there are dozens of examples of open source barcode generators:
Pick one that does what you want to learn about. Downlooad the source and study it.
Actually, I see that you previously asked a similar question about doing this in C++ two months back. Please do a little more research yourself about the problem before posting (or reposting) a question. We're happy to help, but we can help you better if you've already done some of the work, and you'll benefit more that way as well.