順序串算法庫構建

學習賀利堅老師順序串算法庫

數據結構之自建算法庫——順序串_創建順序串s1,創建順序串s2-CSDN博客

本人詳細解析博客

串的概念及操作_串的基本操作-CSDN博客

版本更新日志

V1.0: 在賀利堅老師算法庫指導下, 結合本人詳細解析博客思路基礎上,進行測試, 加入異常彈出信息

v1.0補丁: 完善Error ,合法性檢測內部,加入英語提示,并有對應函數標號

V1.0

函數功能:

//(1)將一個字符串數組賦值給順序串
void Assignment_Sequential_string(Sequential_string &New_String, char Assign_array[]);
//(2) 復制一個串,到另一個串
void Copy_Sequential_String(Sequential_string &accept_string, Sequential_string copy_string);
//(3)判斷兩個串是否相等
bool Equal_Sequential_String(Sequential_string judge_string1, Sequential_string judge_string2);
//(4)求順序串串長
int Length_Sequential_String(Sequential_string measure_string);
//(5)串連接
Sequential_string Connect_Sequential_String(Sequential_string link1, Sequential_string link2);
//(6)求子串(從begin_loation開始的number個字符)
Sequential_string Get_Sequential_Substring(Sequential_string substring, int begin_loation, int number);
//(7)插入串(從從begin_loation開始插入字符串,然后組合成新的串)
Sequential_string Insert_Sequential_String(Sequential_string old_string, int begin_loation,Sequential_string insert_string);
//(8)刪除串(從begin 開始的number個字符)
Sequential_string Delete_Sequential_String(Sequential_string old_string, int begin_loation,int number);
//(9)串替換(從begin 開始的number個字符)
Sequential_string Replace_Sequential_String(Sequential_string old_string, int begin_loation,int number,Sequential_string new_string);
//(10)輸出展示串
void Display_Sequential_String(Sequential_string show_String);

順序串頭函數

Sequential_string.h
#ifndef _SEQUENTIAL_STRING_H_INCLUDE
#define _SEQUENTIAL_STRING_H_INCLUDE#include <stdio.h>
#define MaxSize 100 //最多字符個數//順序串數據結構
typedef struct
{char Sequential_string_data[MaxSize];//數組串數據int length;                          //實際串長
}Sequential_string;//(1)將一個字符串數組賦值給順序串
void Assignment_Sequential_string(Sequential_string &New_String, char Assign_array[]);
//(2) 復制一個串,到另一個串
void Copy_Sequential_String(Sequential_string &accept_string, Sequential_string copy_string);
//(3)判斷兩個串是否相等
bool Equal_Sequential_String(Sequential_string judge_string1, Sequential_string judge_string2);
//(4)求順序串串長
int Length_Sequential_String(Sequential_string measure_string);
//(5)串連接
Sequential_string Connect_Sequential_String(Sequential_string link1, Sequential_string link2);
//(6)求子串(從begin_loation開始的number個字符)
Sequential_string Get_Sequential_Substring(Sequential_string substring, int begin_loation, int number);
//(7)插入串(從從begin_loation開始插入字符串,然后組合成新的串)
Sequential_string Insert_Sequential_String(Sequential_string old_string, int begin_loation,Sequential_string insert_string);
//(8)刪除串(從begin 開始的number個字符)
Sequential_string Delete_Sequential_String(Sequential_string old_string, int begin_loation,int number);
//(9)串替換(從begin 開始的number個字符)
Sequential_string Replace_Sequential_String(Sequential_string old_string, int begin_loation,int number,Sequential_string new_string);
//(10)輸出展示串
void Display_Sequential_String(Sequential_string show_String);
#endif

順序串庫函數

Sequential_string.cpp
#include "Sequential_string.h"/**************************************************
(1)函數名: Assignment_Sequential_string
功  能: 將一個字符串數組賦值給順序串
參  數: (1)Sequential_string &New_String:創建的新串(2)char Assign_array[]: 原始字符串數組
注  意:  順序數組,結尾加入'\0'
返回值: 無
**************************************************/
void Assignment_Sequential_string(Sequential_string &New_String, char Assign_array[])
{int counter;for(counter = 0; Assign_array[counter] != '\0'; counter++){New_String.Sequential_string_data[counter] = Assign_array[counter];}New_String.Sequential_string_data[counter] = '\0';New_String.length = counter;    //更新串最大位序
}/**************************************************
(2)函數名: Copy_Sequential_String
功  能: 復制一個串,到另一個串
參  數: (1)Sequential_string &accept_string: 復制成的串(2)Sequential_string copy_string:要復制的串
注  意:  復制成的串,傳回的是地址,所以不用傳回參數
返回值: 無
**************************************************/
void Copy_Sequential_String(Sequential_string &accept_string, Sequential_string copy_string)
{int counter;for(counter = 0; counter < copy_string.length;counter++){accept_string.Sequential_string_data[counter] = copy_string.Sequential_string_data[counter];}accept_string.Sequential_string_data[counter] = '\0';accept_string.length = copy_string.length;
}
/**************************************************
(3)函數名: Equal_Sequential_String
功  能: 判斷兩個串是否相等
參  數: (1)Sequential_string judge_string1:第一個串(2)Sequential_string judge_string2:第二個串
返回值: bool?是否相等,true:false
**************************************************/
bool Equal_Sequential_String(Sequential_string judge_string1, Sequential_string judge_string2)
{bool same = true;int counter;if(judge_string1.length != judge_string2.length){same = false;}else{for(counter = 0; counter < judge_string1.length;counter++){if(judge_string1.Sequential_string_data[counter] != judge_string2.Sequential_string_data[counter]){same = false;break;}}}return same;}/**************************************************
(4)函數名: Length_Sequential_String
功  能: 求順序串串長
參  數: Sequential_string measure_string:要進行測量的串
返回值: int:順序串長度信息
**************************************************/
int Length_Sequential_String(Sequential_string measure_string)
{return measure_string.length;
}/**************************************************
(5)函數名: Connect_Sequential_String
功  能: 把兩個串連接成一個串
參  數: Sequential_string link1, Sequential_string link2:兩個要鏈接的串
返回值: 返回Sequential_string Connection_string: 鏈接成的串
**************************************************/
Sequential_string Connect_Sequential_String(Sequential_string link1, Sequential_string link2)
{Sequential_string Connection_string;int counter;Connection_string.length = link1.length + link2.length;//將第一個串加入鏈接的串for(counter = 0; counter < link1.length; counter++){Connection_string.Sequential_string_data[counter] = link1.Sequential_string_data[counter];}//將第二個串加入鏈接的串for(counter = 0; counter < link2.length; counter++){Connection_string.Sequential_string_data[link1.length+counter] = link2.Sequential_string_data[counter];}Connection_string.Sequential_string_data[link1.length+counter] = '\0';return Connection_string;
}/**************************************************
(6)函數名: Get_Sequential_Substring
功  能: 求子串(從begin_loation開始的number個字符)
參  數: (1)Sequential_string mother_String:母串(2)int begin_loation:開始分割子串的位置(3)int number:子串的數量
返回值: Sequential_string son_String:得到的子串
**************************************************/
Sequential_string Get_Sequential_Substring(Sequential_string mother_String, int begin_loation, int number)
{Sequential_string son_String;int counter;son_String.length = 0;if(begin_loation <= 0 || begin_loation > mother_String.length || number < 0 || begin_loation+number-1>mother_String.length){//錯誤:分割的子字符串的位置錯誤。printf("\nError<6>:The position of the divided substring is wrong.\n");return son_String; //    參數不正確返回空串}for(counter = begin_loation-1; counter < begin_loation+number-1; counter++){son_String.Sequential_string_data[counter-begin_loation+1] = mother_String.Sequential_string_data[counter];}son_String.Sequential_string_data[counter-begin_loation+1] = '\0';son_String.length = number;return son_String;
}/**************************************************
(7)函數名: Insert_Sequential_String
功  能: 插入串(從從begin_loation開始插入字符串,然后組合成新的串)
參  數: (1)Sequential_string old_string:在原始串的基礎上插入(2)int begin_loation: 插入的位置(3)Sequential_string insert_string:插入的新串
思  路:  在原有串的基礎上,割開一個口子,放上新串,然后組合成新串
返回值: Sequential_string form_string:組合成的新串
**************************************************/
Sequential_string Insert_Sequential_String(Sequential_string old_string, int begin_loation,Sequential_string insert_string)
{int counter;Sequential_string form_string;form_string.length = 0;//參數不正確, 返回空串if(begin_loation <= 0 || begin_loation > old_string.length+1){//錯誤:插入位置錯誤printf("\nError<7>: wrong insertion position.\n");return form_string;}for(counter = 0; counter < begin_loation-1;counter++){form_string.Sequential_string_data[counter] = old_string.Sequential_string_data[counter];}for(counter = 0; counter < insert_string.length;counter++){form_string.Sequential_string_data[begin_loation-1+counter] = insert_string.Sequential_string_data[counter];}for(counter = begin_loation-1; counter<old_string.length;counter++){form_string.Sequential_string_data[insert_string.length+counter] = old_string.Sequential_string_data[counter];}form_string.Sequential_string_data[insert_string.length+counter] = '\0';form_string.length = old_string.length + insert_string.length;return form_string;}
/**************************************************
(8)函數名: Delete_Sequential_String
功  能: 刪除串(從begin 開始的number個字符)
參  數: (1)Sequential_string old_string:在原有串的基礎上刪除(2)int begin_loation: 開始刪除的位置(從邏輯1開始)(3)int number:刪除的數量
注  意:  要判斷刪除的位置和數量是否正確
返回值:Sequential_string new_string:刪除完后的新串
**************************************************/
Sequential_string Delete_Sequential_String(Sequential_string old_string, int begin_loation,int number)
{int counter;//定義計數器Sequential_string new_string;new_string.length = 0;//合法性判斷(begin_loation理應從1開始到leng長度)if(begin_loation <= 0 || begin_loation > old_string.length || (begin_loation+number-1) > old_string.length){//錯誤:刪除的位置或數量錯誤。printf("Error<8>: Wrong location or quantity of deletion.");return new_string;//返回空串}//擇出刪除位置之前的串for(counter = 0; counter < begin_loation-1;counter++){new_string.Sequential_string_data[counter] = old_string.Sequential_string_data[counter];}//擇出刪除位置之后的串for(counter = begin_loation+number-1; counter < old_string.length; counter++){new_string.Sequential_string_data[counter-number] = old_string.Sequential_string_data[counter];}new_string.Sequential_string_data[counter-number] = '\0';new_string.length = old_string.length - number;return new_string;
}/**************************************************
(9)函數名: Replace_Sequential_String
功  能: 串替換(從begin 開始的number個字符)
參  數: (1)Sequential_string old_string:原始串(2)int begin_loation:開始替換的位置(3)int number:替換的字符個數(4)Sequential_string replace_string:要替換成的字符串
思  路: 鎖定old_string從begin_loation開始的number個字符,然后開始剪切建立新串,①把begin_loation之前的字符加入新串,②要替換成的串加入,③鎖定后的字符加入④組合成新串,返回傳出
注  意:  最后加'\0'
返回值: Sequential_string new_string:替換后,產生的新串
**************************************************/
Sequential_string Replace_Sequential_String(Sequential_string old_string, int begin_loation,int number,Sequential_string replace_string)
{int counter;Sequential_string new_string;new_string.length = 0;//合法性判斷if(begin_loation <= 0 || begin_loation > old_string.length || begin_loation+number-1>old_string.length){//錯誤:要替換位置出現錯誤printf("\nError<9>: There is an error in the position to be replaced.\n");return new_string;//返回空串}//開始復制剪切for(counter = 0; counter < begin_loation-1; counter++){new_string.Sequential_string_data[counter] = old_string.Sequential_string_data[counter];}//加入要替換的串for(counter = 0; counter < replace_string.length; counter++){new_string.Sequential_string_data[begin_loation-1+counter] = replace_string.Sequential_string_data[counter];}//被替換位置,后面剩余的串for(counter = begin_loation+number-1; counter < old_string.length; counter++){new_string.Sequential_string_data[counter-number+replace_string.length] = old_string.Sequential_string_data[counter];}new_string.Sequential_string_data[counter-number+replace_string.length] = '\0';new_string.length = old_string.length - number + replace_string.length;return new_string;
}/**************************************************
(10)函數名: Display_Sequential_String
功  能: 輸出展示串
參  數: Sequential_string show_String:要輸出展示的串
注  意: 字符串后續可以換成自定義類型
返回值: 無
**************************************************/
void Display_Sequential_String(Sequential_string show_String)
{int counter;if(show_String.length > 0){for(counter = 0; counter < show_String.length; counter++){printf("%c", show_String.Sequential_string_data[counter]);}printf("\n");}
}

main函數測試 1:

范圍正常情況下測試:

主函數文件名字

main.cpp
#include <stdio.h>
#include "Sequential_string.h"int main()
{Sequential_string test_string,test_string1,test_string2,test_string3,test_string4;char test_char1[ ] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','\0'};char test_char2[] = {'1','2','3','\0'};printf("\n順序串的基本運算如下:\n");printf("\n(1)建立串test_string和test_string1\n");Assignment_Sequential_string(test_string, test_char1);printf("\n(2)輸出串test_string:\n");Display_Sequential_String(test_string);Assignment_Sequential_string(test_string1, test_char2);printf("\n(2)輸出串test_string1:\n");Display_Sequential_String(test_string1);printf("\n(3)串test_string的長度是:%d\n",Length_Sequential_String(test_string));printf("\n(4)在串test_string的第9個字符位置插入串test_string1,從而產生test_string2\n");test_string2 = Insert_Sequential_String(test_string,9,test_string1);printf("\n(5)輸出串test_string2:\n");Display_Sequential_String(test_string2);printf("\n(6)刪除串test_string2第2個字符開始的五個字符,而產生串2\n");test_string2 = Delete_Sequential_String(test_string2,2,5);printf("\n(7)輸出串test_string2:\n");Display_Sequential_String(test_string2);printf("\n(8)將串2第二個字符開始的5個字符替換成串1,從而產生串2\n");test_string2 = Replace_Sequential_String(test_string2,2,5,test_string1);printf("\n(9)輸出串2\n");Display_Sequential_String(test_string2);printf("\n(10)提取串2的第二個字符開始的5個字符而產生串3\n");test_string3 = Get_Sequential_Substring(test_string2,2,5);printf("\n(11)輸出串3\n");Display_Sequential_String(test_string3);printf("\n(12)將串2和串3鏈接起來,而產生串4\n");test_string4 = Connect_Sequential_String(test_string2,test_string3);printf("\n(13)輸出串4\n");Display_Sequential_String(test_string4);return 0;
}

運行結果展示:

main函數測試 2:

范圍超出情況下測試:

主函數文件名字

main.cpp
#include <stdio.h>
#include "Sequential_string.h"int main()
{Sequential_string test_string,test_string1,test_string2,test_string3,test_string4;char test_char1[ ] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','\0'};char test_char2[] = {'1','2','3','\0'};printf("\n順序串的基本運算如下:\n");printf("\n(1)建立串test_string和test_string1\n");Assignment_Sequential_string(test_string, test_char1);printf("\n(2)輸出串test_string:\n");Display_Sequential_String(test_string);Assignment_Sequential_string(test_string1, test_char2);printf("\n(2)輸出串test_string1:\n");Display_Sequential_String(test_string1);printf("\n(3)串test_string的長度是:%d\n",Length_Sequential_String(test_string));printf("\n(4)在串test_string的第100個字符位置插入串test_string1,從而產生test_string2\n");test_string2 = Insert_Sequential_String(test_string,100,test_string1);printf("\n(5)輸出串test_string2:\n");Display_Sequential_String(test_string2);printf("\n(6)刪除串test_string2第99個字符開始的五個字符,而產生串2\n");test_string2 = Delete_Sequential_String(test_string2,99,5);printf("\n(7)輸出串test_string2:\n");Display_Sequential_String(test_string2);printf("\n(8)將串2第88個字符開始的5個字符替換成串1,從而產生串2\n");test_string2 = Replace_Sequential_String(test_string2,88,5,test_string1);printf("\n(9)輸出串2\n");Display_Sequential_String(test_string2);printf("\n(10)提取串2的第33個字符開始的5個字符而產生串3\n");test_string3 = Get_Sequential_Substring(test_string2,33,5);printf("\n(11)輸出串3\n");Display_Sequential_String(test_string3);printf("\n(12)將串2和串3鏈接起來,而產生串4\n");test_string4 = Connect_Sequential_String(test_string2,test_string3);printf("\n(13)輸出串4\n");Display_Sequential_String(test_string4);return 0;
}

運行結果展示:

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/38450.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/38450.shtml
英文地址,請注明出處:http://en.pswp.cn/web/38450.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

已解決java.awt.geom.NoninvertibleTransformException:在Java2D中無法逆轉的轉換的正確解決方法,親測有效!!!

已解決java.awt.geom.NoninvertibleTransformException&#xff1a;在Java2D中無法逆轉的轉換的正確解決方法&#xff0c;親測有效&#xff01;&#xff01;&#xff01; 目錄 問題分析 出現問題的場景 報錯原因 解決思路 解決方法 1. 檢查縮放因子 修改后的縮放變換 …

關鍵路徑——C語言(理論)

關鍵路徑&#xff0c;是項目網絡中從起始事件到終止事件的最長路徑&#xff0c;決定了項目的最短完成時間。 關鍵路徑中的任務沒有任何可調整的余地&#xff0c;如果任何一個任務被延遲&#xff0c;整個項目的完成時間也會被延遲。 假設我們現在有一個圖&#xff1a;把圖的邊…

node編譯打包Error: error:0308010C:digital envelope routines::unsupported

問題描述&#xff1a; 報錯&#xff1a;Error: error:0308010C:digital envelope routines::unsupported 報錯原因&#xff1a; 主要是因為 nodeJs V17 版本發布了 OpenSSL3.0 對算法和秘鑰大小增加了更為嚴格的限制&#xff0c;nodeJs v17 之前版本沒影響&#xff0…

【CH32V305FBP6】USBD HS 虛擬串口分析

文章目錄 前言分析端點 0USBHS_UIS_TOKEN_OUT 端點 2USBHS_UIS_TOKEN_OUTUSBHS_UIS_TOKEN_IN 前言 虛擬串口&#xff0c;端口 3 單向上報&#xff0c;端口 2 雙向收發。 分析 端點 0 USBHS_UIS_TOKEN_OUT 設置串口參數&#xff1a; 判斷 USBHS_SetupReqCode CDC_SET_LIN…

玩轉HarmonyOS NEXT之配置文件篇

配置文件概述 本文以Stage模型為例&#xff0c;詳細介紹了HarmonyOS NEXT應用的各種配置文件&#xff0c;這些配置文件會向編譯工具、操作系統和應用市場提供應用的基本信息。 在基于Stage模型開發的應用項目代碼下&#xff0c;都存在一個app.json5的配置文件、以及一個或者多…

從零開始實現大語言模型(一):概述

1. 前言 大家好&#xff0c;我是何睿智。我現在在做大語言模型相關工作&#xff0c;我用業余時間寫一個專欄&#xff0c;給大家講講如何從零開始實現大語言模型。 從零開始實現大語言模型是了解其原理及領域大語言模型實現路徑的最好方法&#xff0c;沒有之一。已有研究證明&…

《昇思25天學習打卡營第07天|函數式自動微分》

函數式自動微分 環境配置 # 實驗環境已經預裝了mindspore2.2.14&#xff0c;如需更換mindspore版本&#xff0c;可更改下面mindspore的版本號 !pip uninstall mindspore -y !pip install -i https://pypi.mirrors.ustc.edu.cn/simple mindspore2.2.14 import numpy as np imp…

Windows10錄屏,教你3個方法,簡單快速錄屏

“我的電腦系統是Windows10的系統&#xff0c;今晚要進行線上開會&#xff0c;但我實在有事沒辦法參加會議&#xff0c;想把會議的內容錄制下來方便我后續觀看。但卻找不到電腦錄屏功能在哪里打開&#xff1f;求助一下&#xff0c;誰能幫幫我&#xff1f;” 在數字化時代&…

mysql 命令 —— 查看表信息(show table status)

查詢表信息&#xff0c;如整個表的數據量大小、表的索引占用空間大小等 1、查詢某個庫下面的所有表信息&#xff1a; SHOW TABLE STATUS FROM your_database_name;2、查詢指定的表信息&#xff1a; SHOW TABLE STATUS LIKE your_table_name;如&#xff1a;Data_length 顯示表…

閑聊 .NET Standard

前言 有時候&#xff0c;我們從 Nuget 下載第三方包時&#xff0c;會看到這些包的依賴除了要求 .NET FrameWork、.NET Core 等的版本之外&#xff0c;還會要求 .NET Standard 的版本&#xff0c;比如這樣&#xff1a; 這個神秘的 .NET Standard 是什么呢&#xff1f; .NET St…

【算法】字母異位詞分組

題目&#xff1a;字母異位詞分組 給你一個字符串數組&#xff0c;請你將 字母異位詞 組合在一起。可以按任意順序返回結果列表。 字母異位詞 是由重新排列源單詞的所有字母得到的一個新單詞。 示例 1: 輸入: strs [“eat”, “tea”, “tan”, “ate”, “nat”, “bat”] …

從零開始搭建spring boot多模塊項目

一、搭建父級模塊 1、打開idea,選擇file–new–project 2、選擇Spring Initializr,選擇相關java版本,點擊“Next” 3、填寫父級模塊信息 選擇/填寫group、artifact、type、language、packaging(后面需要修改)、java version(后面需要修改成和第2步中版本一致)。點擊“…

【0300】Postgres內核動態哈希表實現機制(1)

相關文章&#xff1a; 【0299】Postgres內核之哈希表&#xff08;Hash Tables&#xff09; 0 概述 在【0299】Postgres內核之哈希表&#xff08;Hash Tables&#xff09;一文中&#xff0c;講解了哈希表的作用、實現、優缺點等特性。本文開始&#xff0c;將詳細分析Postgres內…

MySQL之應用層優化(三)

應用層優化 應用層緩存 2.本地共享內存緩存 這種緩存一般是中等大小(幾個GB)&#xff0c;快速&#xff0c;難以在多臺機器間同步。它們對小型的半靜態位數據比較合適。例如每個州的城市列表&#xff0c;分片數據存儲的分區函數(映射表)&#xff0c;或者使用存活時間(TTL)策略…

記錄一次Chrome瀏覽器自動排序ajax請求的JSON數據問題

文章目錄 1.前言2. 為什么會這樣&#xff1f;3.如何解決&#xff1f; 1.前言 作者作為新人入職的第一天&#xff0c;mentor給了一個維護公司運營平臺的小需求&#xff0c;具體需求是根據運營平臺的某個管理模塊所展示記錄的某些字段對展示記錄做排序。 第一步&#xff1a; myb…

工業觸摸一體機優化MES應用開發流程

工業觸摸一體機在現代工業生產中扮演著至關重要的角色&#xff0c;它集成了智能觸摸屏和工業計算機的功能&#xff0c;廣泛應用于各種生產場景中。而制造執行系統&#xff08;MES&#xff09;作為工業生產管理的重要工具&#xff0c;對于提高生產效率、降低成本、優化資源利用具…

力扣hot100-普通數組

文章目錄 題目&#xff1a;最大子數組和方法1 動態規劃方法2 題目&#xff1a;合并區間題解 題目&#xff1a;最大子數組和 原題鏈接&#xff1a;最大子數組和 方法1 動態規劃 public class T53 {//動態規劃public static int maxSubArray(int[] nums) {if (nums.length 0…

C++基礎知識-編譯相關

記錄C語言相關的基礎知識 1 C源碼到可執行文件的四個階段 預處理(.i)、編譯(.s)、匯編(.obj)、鏈接。 1.1 預處理 預處理階段&#xff0c;主要完成宏替換、文件展開、注釋刪除、條件編譯展開、添加行號和文件名標識&#xff0c;輸出.i/.ii預處理文件。 宏替換&#xff0c;…

【UML用戶指南】-26-對高級行為建模-狀態圖

目錄 1、概念 2、組成結構 3、一般用法 4、常用建模技術 4.1、對反應型對象建模 一個狀態圖顯示了一個狀態機。在為對象的生命期建模中 活動圖展示的是跨過不同的對象從活動到活動的控制流 狀態圖展示的是單個對象內從狀態到狀態的控制流。 在UML中&#xff0c;用狀態圖…

tcpdump命令詳解及使用實例

1、抓所有網卡數據包&#xff0c;保存到指定路徑 tcpdump -i any -w /oemdata/123.pcap&一、tcpdump簡介 tcpdump可以將網絡中傳送的數據包完全截獲下來提供分析。它支持針對網絡層、協議、主機、網絡或端口的過濾&#xff0c;并提供and、or、not等邏輯語句來去掉無用的信…