字符串和数字之间的相互转换
数字转为字符串:
方法1:使用sprintf
1 | int num=10; |
方法2:使用最原始的方式进行转换
1 | int num=10; |
方法3:to_string函数
1 | int num=10; |
方法4:_itoa函数
1 | int num=10; |
字符串转数字:**
方法1:sscanf
1 | char str[]="100"; |
方法2:atoi函数
1 | char str[]="100"; |
方法3:
1 | string str="100"; |
转载请标明出处,谢谢
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true