An uncompressed bitcoin public key is 65 bytes long, made up of "04", followed by the 32 byte x coordinate and then the 32 byte y coordinate.
A compressed public key is 33 bytes long, made up of either "02" or "03" depending on if the y coordinate is positive or negative, and then the 32 byte x coordinate.
An address is not simply a public key in Base58Check. To convert a public key to an address, you must first SHA-256 hash it, then RIPEMD-160 hash it, then add a 0x00 network byte to the start, SHA-256 hash it twice, take the first four bytes of this hash as a checksum and append it to the end, and then convert the whole thing to Base58Check. If you want to work backwards from an address, you can only strip the checksum and network byte to arrive at the RIPEMD-160 hash output. You can't go back any further to find the public key.
there're two \0 bytes to be added . second one added to start right before base58 op.
char *t = new char[1000]();
char *tbitaddr = new char[1000]();
size_t c = 1000;
size_t cbit = 1000;
unsigned char bitaddr[25] = {};
unsigned char pubhash_md[20] = {};
unsigned char pubhash_mdprefx[21] = {};
unsigned char pubhash[32] = {};
unsigned char hashtag[32] = {};
unsigned char hashtag_f[32] = {};
const unsigned char b[66] = "BurnItAll0000000000000000000000000000000000000000000000000000000b";
SHA256(b, 65, pubhash);
RIPEMD160(pubhash,32,pubhash_md);
pubhash_mdprefx[0] = 0x0;
memcpy(pubhash_mdprefx + 1, pubhash_md , 20);
SHA256(pubhash_mdprefx, 21, hashtag);
SHA256(hashtag, 32, hashtag_f);
bitaddr[0] = 0x0;
memcpy(bitaddr + 1, pubhash_md, 20);
memcpy(bitaddr + 21, hashtag_f, 4);
b58enc(tbitaddr,&cbit,(void *)bitaddr,(size_t)(sizeof(bitaddr)));
b58enc(t,&c,(void *)b,(size_t)(sizeof(b)-1));
std::cout << "pubkey :" << std::endl << t << std::endl << "address:" << std::endl << tbitaddr << std::endl;