/*数字转换成字符串*/
#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
	int num = 12345;
	char str[20];

	sprintf(str, "%d", num);

	cout << str;
}

 

 

 

/*数字转换成字符串*/
#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
	int num;
	char str[20] = "12345";

	sscanf(str, "%d", &num);
	cout << sizeof(num) << "" << num;
}

相关文章:

  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-08-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-17
  • 2022-01-02
  • 2022-02-08
  • 2021-09-14
  • 2022-01-12
  • 2022-01-21
相关资源
相似解决方案