При попытке собрать ругается:
$ g++ *.cpp -o test
text.cpp: In member function ‘void TEXT::AddInt(unsigned int)’:
text.cpp:64:19: error: invalid conversion from ‘int’ to ‘char*’ [-fpermissive]
64 | AddText(snprintf(buf, 7, "%i", i));
| ~~~~~~~~^~~~~~~~~~~~~~~~~
| |
| int
Вот код:
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include "text.h"
...
void TEXT::AddInt(unsigned int i)
{
char buf[7];
//AddText(itoa(i,buf,10));
AddText(snprintf(buf, 7, "%i", i));
}