#include <iostream>
using namespace std;
int main()
{
char buffer[8];
int field=534;
memcpy(buffer,&field,sizeof(field));
cout<<buffer<<endl;
return 0;
}
This returns an empty buffer. Why?
Basically looking for an alternative to sprintf to convert int to char buffer.
Itoa is not available.
Thoughts? Better alternatives?