Hi all,
I need to print characters and integers together in a string.
I know about sprintf in C as it is used like the following:
char str[] = "num%d num%d num%d";
int a = 5;
int b = 6;
int c = 7;
sprintf(str,a,b,c) ;
Is there a same function which does the same in C++.
I tried sprintf as following:
char str[] = "num%d";
int a = 5;
sprintf(str,a);
This makes "a" a character and puts it in "str" but does not do the same as sprintf in C.
I tried searching for a C++ library function but was not able to find one. any help is appreciated.Thanks in advance.