最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

C/C++中CJSON的使用(創(chuàng)建與解析JSON數(shù)據(jù))

 更新時(shí)間:2021年09月21日 10:48:06   作者:DS小龍哥  
cJSON是一個(gè)超輕巧的JSON解析器,本文主要介紹了C/C++中CJSON的使用(創(chuàng)建與解析JSON數(shù)據(jù)),具有一定的參考價(jià)值,感興趣的可以了解一下

一、cJSON介紹

cJSON 是一個(gè)超輕巧,攜帶方便,單文件,可以作為 ANSI-C 標(biāo)準(zhǔn)的 JSON 解析器,是一個(gè)用C語(yǔ)言編寫(xiě)的簡(jiǎn)單好用的JSON解析器;它只包含一個(gè)C文件和一個(gè)頭文件,可以非常容易集成到自己工程項(xiàng)目中。

并且cJSON是用ANSI C(C89)編寫(xiě)的,可以兼容所有支持C語(yǔ)言的平臺(tái)和編譯器。

cJSON下載地址: https://sourceforge.net/projects/cjson/

cJSON的GitHub倉(cāng)庫(kù)地址:https://github.com/DaveGamble/cJSON

二、JSON簡(jiǎn)介、語(yǔ)法介紹

2.1 JSON是什么?

JSON是JavaScript Object Notation(JavaScript對(duì)象表示法),是一種輕量級(jí)的數(shù)據(jù)交換格式。

JSON主要是用來(lái)存儲(chǔ)和交換文本信息,類(lèi)似XML格式;但是JSON比XML更小、更快,更易解析。

JSON是基于ECMAScript (歐洲計(jì)算機(jī)協(xié)會(huì)制定的js規(guī)范)的一個(gè)子集,采用完全獨(dú)立于編程語(yǔ)言的文本格式來(lái)存儲(chǔ)和表示數(shù)據(jù)。

簡(jiǎn)潔和清晰的層次結(jié)構(gòu)使得 JSON 成為理想的數(shù)據(jù)交換語(yǔ)言。 易于人閱讀和編寫(xiě),同時(shí)也易于機(jī)器解析和生成,并有效地提升網(wǎng)絡(luò)傳輸效率。 比如: Web服務(wù)器接口基本都是采用JSON反饋數(shù)據(jù),采用JSON格式字符串來(lái)描述符信息。 JSON文件的后綴一般是.json,這個(gè)只是為了方便辨識(shí)。

簡(jiǎn)單的說(shuō),JSON就是按照指定格式序列化的字符串,就算不使用任何現(xiàn)成的解析庫(kù),自己也可以按照正常解析字符串的思路去解析;有現(xiàn)成的標(biāo)準(zhǔn)JSON解析庫(kù),那就大大減輕了我們的工作量。

JSON格式的數(shù)據(jù)示例: 這是表示當(dāng)前時(shí)間的JSON字符串

{
  "success": "1",
  "result": {
    "timestamp": "1631849514",
    "datetime_1": "2021-09-17 20:31:54",
    "datetime_2": "2021年09月17日 20時(shí)31分54秒",
    "week_1": "5",
    "week_2": "星期五",
    "week_3": "周五",
    "week_4": "Friday"
  }
}

JSON格式的數(shù)據(jù)示例: 這是表示未來(lái)幾天天氣預(yù)報(bào)的json字符串

{
  "success": "1",
  "result": [
    {
      "weaid": "1",
      "days": "2021-09-17",
      "week": "星期五",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "26℃/17℃",
      "humidity": "0%/0%",
      "weather": "晴",
      "weather_icon": "http://api.k780.com/upload/weather/d/0.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/0.gif",
      "wind": "北風(fēng)轉(zhuǎn)西南風(fēng)",
      "winp": "小于3級(jí)",
      "temp_high": "26",
      "temp_low": "17",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "1",
      "weatid1": "1",
      "windid": "8",
      "winpid": "0",
      "weather_iconid": "0",
      "weather_iconid1": "0"
    },
    {
      "weaid": "1",
      "days": "2021-09-18",
      "week": "星期六",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "25℃/17℃",
      "humidity": "0%/0%",
      "weather": "多云",
      "weather_icon": "http://api.k780.com/upload/weather/d/1.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/1.gif",
      "wind": "西南風(fēng)",
      "winp": "小于3級(jí)",
      "temp_high": "25",
      "temp_low": "17",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "2",
      "weatid1": "2",
      "windid": "5",
      "winpid": "0",
      "weather_iconid": "1",
      "weather_iconid1": "1"
    },
    {
      "weaid": "1",
      "days": "2021-09-19",
      "week": "星期日",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "19℃/15℃",
      "humidity": "0%/0%",
      "weather": "小雨轉(zhuǎn)中雨",
      "weather_icon": "http://api.k780.com/upload/weather/d/7.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/8.gif",
      "wind": "西南風(fēng)轉(zhuǎn)北風(fēng)",
      "winp": "小于3級(jí)轉(zhuǎn)小于3級(jí)",
      "temp_high": "19",
      "temp_low": "15",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "8",
      "weatid1": "9",
      "windid": "5",
      "winpid": "0",
      "weather_iconid": "7",
      "weather_iconid1": "8"
    },
    {
      "weaid": "1",
      "days": "2021-09-20",
      "week": "星期一",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "26℃/16℃",
      "humidity": "0%/0%",
      "weather": "多云轉(zhuǎn)晴",
      "weather_icon": "http://api.k780.com/upload/weather/d/1.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/0.gif",
      "wind": "北風(fēng)",
      "winp": "3-4級(jí)轉(zhuǎn)3-4級(jí)",
      "temp_high": "26",
      "temp_low": "16",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "2",
      "weatid1": "1",
      "windid": "8",
      "winpid": "1",
      "weather_iconid": "1",
      "weather_iconid1": "0"
    },
    {
      "weaid": "1",
      "days": "2021-09-21",
      "week": "星期二",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "27℃/16℃",
      "humidity": "0%/0%",
      "weather": "晴",
      "weather_icon": "http://api.k780.com/upload/weather/d/0.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/0.gif",
      "wind": "西北風(fēng)轉(zhuǎn)北風(fēng)",
      "winp": "小于3級(jí)",
      "temp_high": "27",
      "temp_low": "16",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "1",
      "weatid1": "1",
      "windid": "7",
      "winpid": "0",
      "weather_iconid": "0",
      "weather_iconid1": "0"
    },
    {
      "weaid": "1",
      "days": "2021-09-22",
      "week": "星期三",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "26℃/18℃",
      "humidity": "0%/0%",
      "weather": "多云",
      "weather_icon": "http://api.k780.com/upload/weather/d/1.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/1.gif",
      "wind": "北風(fēng)轉(zhuǎn)東北風(fēng)",
      "winp": "小于3級(jí)",
      "temp_high": "26",
      "temp_low": "18",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "2",
      "weatid1": "2",
      "windid": "8",
      "winpid": "0",
      "weather_iconid": "1",
      "weather_iconid1": "1"
    },
    {
      "weaid": "1",
      "days": "2021-09-23",
      "week": "星期四",
      "cityno": "beijing",
      "citynm": "北京",
      "cityid": "101010100",
      "temperature": "24℃/16℃",
      "humidity": "0%/0%",
      "weather": "多云",
      "weather_icon": "http://api.k780.com/upload/weather/d/1.gif",
      "weather_icon1": "http://api.k780.com/upload/weather/n/1.gif",
      "wind": "東北風(fēng)",
      "winp": "小于3級(jí)",
      "temp_high": "24",
      "temp_low": "16",
      "humi_high": "0",
      "humi_low": "0",
      "weatid": "2",
      "weatid1": "2",
      "windid": "1",
      "winpid": "0",
      "weather_iconid": "1",
      "weather_iconid1": "1"
    }
  ]
}

2.2 JSON語(yǔ)法介紹

JSON里就分為兩種結(jié)構(gòu): 對(duì)象和數(shù)組,通過(guò)這兩種結(jié)構(gòu)可以表示各種復(fù)雜的結(jié)構(gòu)。

JSON語(yǔ)法規(guī)則
1. 大括號(hào) { } 用來(lái)保存對(duì)象
2. 中括號(hào) [ ] 用來(lái)保存數(shù)組,數(shù)組里也可以包含多個(gè)對(duì)象,對(duì)象里又可以包含數(shù)組,可以嵌套
3. JSON的值表示語(yǔ)法: key : value --> "width": 1280
4. 多個(gè)數(shù)據(jù)由逗號(hào)分隔: {"width": 1920,"height": 1080}

JSON值可以是以下幾種類(lèi)型:
1. 數(shù)字(整數(shù)或浮點(diǎn)數(shù))
2. 字符串(在雙引號(hào)中)
3. 邏輯值(true 或 false)
4. 數(shù)組(在中括號(hào)中)
5. 對(duì)象(在大括號(hào)中)
6. null (空值)

三、cJSON創(chuàng)建簡(jiǎn)單JSON數(shù)據(jù)并解析

3.1 新建工程

這是下載下來(lái)的cJSON源文件,將它加到自己工程中即可。

我這里使用VS2017建立工程,演示實(shí)例。

建好工程之后,將文件添加到工程里:

在VS2017里使用C語(yǔ)言的字符串處理函數(shù)會(huì)報(bào)錯(cuò),提示不安全;

1>d:\linux-share-dir\vs2017\console_cjsontest\console_cjsontest\cjson.c(155): error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

解決辦法是:找到【項(xiàng)目屬性】,點(diǎn)擊【C++】里的【預(yù)處理器】,對(duì)【預(yù)處理器】進(jìn)行編輯,在里面加入一段代碼:_CRT_SECURE_NO_WARNINGS。

3.2 創(chuàng)建JSON數(shù)據(jù)

接下來(lái)目標(biāo)是使用cJSON創(chuàng)建出下面這樣一個(gè)JSON格式數(shù)據(jù):

{
  "text": "我是一個(gè)字符串?dāng)?shù)據(jù)",
  "number": 666,
  "state1": false,
  "state2": true,
  "state3": null
}

示例代碼如下:

#include <iostream>
 
//因?yàn)楫?dāng)前工程使用的是cpp后綴文件,引用C語(yǔ)言的文件需要使用下面的這種方式
extern "C" {
#include <string.h>
#include <stdio.h>
#include "cJSON.h"
}
 
int main()
{
	//1. 創(chuàng)建cJSON對(duì)象
	cJSON* root = cJSON_CreateObject();
	
	//2. 創(chuàng)建數(shù)據(jù)
	cJSON_AddStringToObject(root, "text","我是一個(gè)字符串?dāng)?shù)據(jù)");
	cJSON_AddNumberToObject(root,"number",666);
	cJSON_AddBoolToObject(root, "state1", cJSON_False);
	cJSON_AddBoolToObject(root, "state2", cJSON_True);
	cJSON_AddNullToObject(root, "state3");
 
	//3. 打印生成的結(jié)果
	char *json_data=cJSON_PrintUnformatted(root);
	printf("%s\n",json_data);
 
	//4. 釋放空間
	cJSON_Delete(root);
	return 0;
}
 

3.3 解析JSON數(shù)據(jù)

#include <iostream>
 
//因?yàn)楫?dāng)前工程使用的是cpp后綴文件,引用C語(yǔ)言的文件需要使用下面的這種方式
extern "C" {
#include <string.h>
#include <stdio.h>
#include "cJSON.h"
}
 
//將要解析的JSON數(shù)據(jù). 
char data[] =
"{"
	"\"text\": \"我是一個(gè)字符串?dāng)?shù)據(jù)\","
	"\"number\" : 666,"
	"\"state1\" : false,"
	"\"state2\" : true,"
	"\"state3\" : null"
"}";
 
 
int main()
{
	//1. 載入JSON數(shù)據(jù)
	cJSON* root = cJSON_Parse(data);
	if (root == NULL)return 0;
 
	//2. 解析字段
	cJSON* item;
 
	item=cJSON_GetObjectItem(root,"text");
	if (item)
	{
		printf("text=%s\n",item->valuestring);
	}
 
	item = cJSON_GetObjectItem(root, "number");
	if (item)
	{
		printf("text=%d\n", item->valueint);
	}
 
	item = cJSON_GetObjectItem(root, "state1");
	if (item)
	{
		printf("state1=%d\n", item->valueint);
	}
 
	item = cJSON_GetObjectItem(root, "state2");
	if (item)
	{
		printf("state2=%d\n", item->valueint);
	}
 
	item = cJSON_GetObjectItem(root, "state3");
	if (item)
	{
		printf("state3=%d\n", item->valueint);
	}
 
	//3. 釋放空間
	cJSON_Delete(root);
	return 0;
}
 

四、cJSON創(chuàng)建嵌套的對(duì)象數(shù)據(jù)

目標(biāo): 使用cJSON創(chuàng)建出下面這樣一個(gè)JSON格式數(shù)據(jù)

{
  "data1": {
    "text": "我是一個(gè)字符串?dāng)?shù)據(jù)1",
    "number": 666,
    "state1": false,
    "state2": true,
    "state3": null
  },
  "data2": {
    "text": "我是一個(gè)字符串?dāng)?shù)據(jù)2",
    "number": 666,
    "state1": false,
    "state2": true,
    "state3": null
  }
}

4.1 創(chuàng)建json數(shù)據(jù)

#include <iostream>
 
//因?yàn)楫?dāng)前工程使用的是cpp后綴文件,引用C語(yǔ)言的文件需要使用下面的這種方式
extern "C" {
#include <string.h>
#include <stdio.h>
#include "cJSON.h"
}
 
int main()
{
	//1. 創(chuàng)建cJSON對(duì)象
	cJSON* root = cJSON_CreateObject();
	
	//2. 創(chuàng)建對(duì)象數(shù)據(jù)1
	cJSON* item1 = cJSON_CreateObject();
	cJSON_AddStringToObject(item1, "text","我是一個(gè)字符串?dāng)?shù)據(jù)1");
	cJSON_AddNumberToObject(item1,"number",666);
	cJSON_AddBoolToObject(item1, "state1", cJSON_False);
	cJSON_AddBoolToObject(item1, "state2", cJSON_True);
	cJSON_AddNullToObject(item1, "state3");
	cJSON_AddItemToObject(root, "data1", item1);
 
	//3. 創(chuàng)建對(duì)象數(shù)據(jù)2
	cJSON* item2 = cJSON_CreateObject();
	cJSON_AddStringToObject(item2, "text", "我是一個(gè)字符串?dāng)?shù)據(jù)2");
	cJSON_AddNumberToObject(item2, "number", 666);
	cJSON_AddBoolToObject(item2, "state1", cJSON_False);
	cJSON_AddBoolToObject(item2, "state2", cJSON_True);
	cJSON_AddNullToObject(item2, "state3");
	cJSON_AddItemToObject(root, "data2", item2);
 
	//3. 打印生成的結(jié)果
	char *json_data=cJSON_PrintUnformatted(root);
	printf("%s\n",json_data);
 
	//4. 釋放空間
	cJSON_Delete(root);
	return 0;
}
 

4.2 解析JSON數(shù)據(jù)

#include <iostream>
 
//因?yàn)楫?dāng)前工程使用的是cpp后綴文件,引用C語(yǔ)言的文件需要使用下面的這種方式
extern "C" {
#include <string.h>
#include <stdio.h>
#include "cJSON.h"
}
 
//將要解析的JSON數(shù)據(jù). 
char data[] =
"{"
	"\"data1\": {"
	"\"text\": \"我是一個(gè)字符串?dāng)?shù)據(jù)1\","
	"\"number\" : 666,"
	"\"state1\" : false,"
	"\"state2\" : true,"
	"\"state3\" : null"
	 "},"
	"\"data2\": {"
	"\"text\":\"我是一個(gè)字符串?dāng)?shù)據(jù)2\","
	"\"number\" : 666,"
	"\"state1\" : false,"
	"\"state2\" : true,"
	"\"state3\" : null"
	"}"
"}";
 
int main()
{
	//1. 載入JSON數(shù)據(jù)
	cJSON* root = cJSON_Parse(data);
	if (root == NULL)return 0;
 
	//2. 解析字段
	cJSON* item;
 
	item=cJSON_GetObjectItem(root,"data1");
	if (item)
	{
		cJSON *obj;
		obj=cJSON_GetObjectItem(item, "text");
		if (obj)
		{
			printf("text=%s\n", obj->valuestring);
		}
 
		obj=cJSON_GetObjectItem(item, "number");
		if (obj)
		{
			printf("number=%d\n", obj->valueint);
		}
 
		obj = cJSON_GetObjectItem(item, "state1");
		if (obj)
		{
			printf("state1=%d\n", obj->valueint);
		}
 
		obj = cJSON_GetObjectItem(item, "state2");
		if (obj)
		{
			printf("state2=%d\n", obj->valueint);
		}
 
		obj = cJSON_GetObjectItem(item, "state3");
		if (obj)
		{
			printf("state3=%d\n", obj->valueint);
		}
	}
 
	item = cJSON_GetObjectItem(root, "data2");
	if (item)
	{
		cJSON *obj;
		obj = cJSON_GetObjectItem(item, "text");
		if (obj)
		{
			printf("text=%s\n", obj->valuestring);
		}
 
		obj = cJSON_GetObjectItem(item, "number");
		if (obj)
		{
			printf("number=%d\n", obj->valueint);
		}
 
		obj = cJSON_GetObjectItem(item, "state1");
		if (obj)
		{
			printf("state1=%d\n", obj->valueint);
		}
 
		obj = cJSON_GetObjectItem(item, "state2");
		if (obj)
		{
			printf("state2=%d\n", obj->valueint);
		}
 
		obj = cJSON_GetObjectItem(item, "state3");
		if (obj)
		{
			printf("state3=%d\n", obj->valueint);
		}
	}
 
	//3. 釋放空間
	cJSON_Delete(root);
	return 0;
}
 

五、cJSON帶數(shù)組的JSON數(shù)據(jù)

目標(biāo): 使用cJSON創(chuàng)建出下面這樣一個(gè)JSON格式數(shù)據(jù)

{
  "text": [
    {
      "width": 1280,
      "height": 720
    },
    {
      "width": 1920,
      "height": 1080
    },
    {
      "width": 3840,
      "height": 2160
    }
  ]
}

5.1 創(chuàng)建json數(shù)據(jù)

#include <iostream>
 
//因?yàn)楫?dāng)前工程使用的是cpp后綴文件,引用C語(yǔ)言的文件需要使用下面的這種方式
extern "C" {
#include <string.h>
#include <stdio.h>
#include "cJSON.h"
}
 
int main()
{
	cJSON *width = NULL;
	cJSON *height = NULL;
	int i;
	const unsigned int resolution_numbers[3][2] = {
		{1280, 720},
		{1920, 1080},
		{3840, 2160}
	};
 
	//1. 創(chuàng)建cJSON對(duì)象
	cJSON* root = cJSON_CreateObject();
	
	//2. 創(chuàng)建數(shù)組對(duì)象
	cJSON *array = cJSON_CreateArray();
	cJSON_AddItemToObject(root, "text", array);
 
	for (i = 0; i < (sizeof(resolution_numbers) / (2 * sizeof(int))); ++i)
	{
		cJSON *obj = cJSON_CreateObject();
		cJSON_AddItemToArray(array, obj);
 
		width = cJSON_CreateNumber(resolution_numbers[i][0]);
		cJSON_AddItemToObject(obj, "width", width);
 
		height = cJSON_CreateNumber(resolution_numbers[i][1]);
		cJSON_AddItemToObject(obj, "height", height);
	}
 
	//3. 打印生成的結(jié)果
	char *json_data=cJSON_PrintUnformatted(root);
	printf("%s\n",json_data);
 
	//4. 釋放空間
	cJSON_Delete(root);
	return 0;
}
 

5.2 解析JSON數(shù)據(jù)

#include <iostream>
 
//因?yàn)楫?dāng)前工程使用的是cpp后綴文件,引用C語(yǔ)言的文件需要使用下面的這種方式
extern "C" {
#include <string.h>
#include <stdio.h>
#include "cJSON.h"
}
 
//將要解析的JSON數(shù)據(jù). 
char data[] =
"{"
"\"text\": ["
"{"
"\"width\": 1280,"
"\"height\" : 720"
"},"
"{"
"\"width\": 1920,"
"\"height\" : 1080"
"},"
"{"
"\"width\": 3840,"
"\"height\" : 2160"
"}"
"]"
"}";
 
int main()
{
	//1. 載入JSON數(shù)據(jù)
	cJSON* root = cJSON_Parse(data);
	if (root == NULL)return 0;
	//2. 解析字段
	cJSON* item;
	int i;
	item = cJSON_GetObjectItem(root, "text");
	if (item)
	{
		//獲取數(shù)組的大小
		int ArraySize = cJSON_GetArraySize(item);
		//解析數(shù)組的里的每個(gè)成員
		for (i = 0; i < ArraySize; i++)
		{
			//取出數(shù)組下標(biāo)對(duì)象
			cJSON *array_item = cJSON_GetArrayItem(item, i);
			if (array_item == NULL)continue;
 
			//解析數(shù)據(jù)
			cJSON *obj = cJSON_GetObjectItem(array_item, "width");
			if (obj)
			{
				printf("width=%d\n",obj->valueint);
			}
			obj = cJSON_GetObjectItem(array_item, "height");
			if (obj)
			{
				printf("height=%d\n", obj->valueint);
			}
		}
	}
	
	//3. 釋放空間
	cJSON_Delete(root);
	return 0;
}
 


到此這篇關(guān)于C/C++中CJSON的使用(創(chuàng)建與解析JSON數(shù)據(jù))的文章就介紹到這了,更多相關(guān)C++ CJSON使用內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 基于MFC實(shí)現(xiàn)貪吃蛇小游戲

    基于MFC實(shí)現(xiàn)貪吃蛇小游戲

    這篇文章主要為大家詳細(xì)介紹了基于MFC實(shí)現(xiàn)貪吃蛇小游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-07-07
  • C語(yǔ)言之循環(huán)語(yǔ)句詳細(xì)介紹

    C語(yǔ)言之循環(huán)語(yǔ)句詳細(xì)介紹

    大家好,本篇文章主要講的是C語(yǔ)言之循環(huán)語(yǔ)句詳細(xì)介紹,感興趣的同學(xué)趕快來(lái)看一看吧,對(duì)你有幫助的話(huà)記得收藏一下,方便下次瀏覽
    2021-12-12
  • C++ vector數(shù)組用法及解析

    C++ vector數(shù)組用法及解析

    這篇文章主要給大家分享的是C++ vector數(shù)組用法及解析,什么是什么是vector數(shù)組呢?下面文章將對(duì)打家做詳細(xì)介紹,感興趣的小伙伴可以參考一下
    2021-10-10
  • C語(yǔ)言的基本編寫(xiě)規(guī)范你了解嗎

    C語(yǔ)言的基本編寫(xiě)規(guī)范你了解嗎

    這篇文章主要為大家介紹了C語(yǔ)言的基本編寫(xiě)規(guī)范,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下,希望能夠給你帶來(lái)幫助
    2022-01-01
  • C++四種強(qiáng)制轉(zhuǎn)換原理與價(jià)值

    C++四種強(qiáng)制轉(zhuǎn)換原理與價(jià)值

    這篇文章主要介紹了C++的四種強(qiáng)制轉(zhuǎn)換原理與價(jià)值,文中介紹的非常詳細(xì),對(duì)學(xué)習(xí)C語(yǔ)言有一定的參考價(jià)值,感興趣的小伙伴可以參考一下
    2023-04-04
  • VScode搭建C/C++開(kāi)發(fā)環(huán)境的詳細(xì)過(guò)程

    VScode搭建C/C++開(kāi)發(fā)環(huán)境的詳細(xì)過(guò)程

    最近迷上了vscode,小巧美觀(guān),最主要的是全平臺(tái),但是vscode并不是ide,必須得自己配置環(huán)境,下面這篇文章主要給大家介紹了關(guān)于VScode搭建C/C++開(kāi)發(fā)環(huán)境的詳細(xì)過(guò)程,需要的朋友可以參考下
    2023-06-06
  • C++命名空間namespace的介紹與使用

    C++命名空間namespace的介紹與使用

    今天小編就為大家分享一篇關(guān)于C++命名空間namespace的介紹與使用,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧
    2018-12-12
  • C語(yǔ)言中g(shù)etchar()與putchar()函數(shù)詳解

    C語(yǔ)言中g(shù)etchar()與putchar()函數(shù)詳解

    本文主要介紹了C語(yǔ)言中g(shù)etchar()與putchar()函數(shù)詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2023-01-01
  • 非常經(jīng)典的C語(yǔ)言趣味題目

    非常經(jīng)典的C語(yǔ)言趣味題目

    在這個(gè)網(wǎng)站上發(fā)現(xiàn)一套很有趣的C語(yǔ)言測(cè)試題,如果你招聘C語(yǔ)言相關(guān)開(kāi)發(fā)人員,或者正在學(xué)習(xí)C語(yǔ)言,很值得做一做
    2013-04-04
  • QT5實(shí)現(xiàn)電子時(shí)鐘

    QT5實(shí)現(xiàn)電子時(shí)鐘

    這篇文章主要為大家詳細(xì)介紹了QT5實(shí)現(xiàn)電子時(shí)鐘,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-06-06

最新評(píng)論

潮安县| 靖江市| 太原市| 阳信县| 蕲春县| 成武县| 辽阳市| 丰台区| 华亭县| 平昌县| 广丰县| 赤城县| 曲靖市| 大田县| 临沂市| 杭锦旗| 贺兰县| 毕节市| 阿城市| 吉林省| 澄江县| 湖州市| 武冈市| 武乡县| 永登县| 灵璧县| SHOW| 洪湖市| 齐河县| 兰坪| 吴堡县| 云梦县| 湟源县| 襄垣县| 惠东县| 莎车县| 齐齐哈尔市| 南木林县| 台前县| 黄陵县| 察哈|