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

C語言動態(tài)鏈表實現(xiàn)學生學籍管理系統(tǒng)

 更新時間:2022年07月22日 15:18:43   作者:櫻桃木  
這篇文章主要為大家詳細介紹了C語言動態(tài)鏈表實現(xiàn)學生學籍管理系統(tǒng),文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了C語言利用動態(tài)鏈表實現(xiàn)學生學籍管理系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下

/*
* C語言學生信息管理系統(tǒng)(動態(tài)鏈表版)
* 作者:cbc
* 時間:2018年6月7日
* 功能:增添新鍵數(shù)據(jù)、修改刪除數(shù)據(jù)、查詢統(tǒng)計數(shù)據(jù)
* 平臺:windows
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
# define LEN sizeof(struct Student)
?
struct Student {
?? ?char num[10]; ?/*學號*/
?? ?char name[20]; /*姓名*/
?? ?char sex[10]; ?/*性別*/
?? ?int age; ? ? ? /*年齡*/
?? ?char phone[12];/*電話*/
?? ?char qq[12]; ? /*QQ號*/
?? ?char nativePlace[20];/*籍貫*/
?? ?char department[20];/*系別*/
?? ?char major[20];/*專業(yè)*/
?? ?char className[20];/*班級*/
?? ?struct Student *next;
};
?
char filename[30];//全局變量,用來保存要打開的文件名字
?
?? ??? ??? ??? ? ?/*生成鏈表*/
struct Student *Creat(int n) {
?? ?void menu_print_in(void);
?? ?struct Student *head;
?? ?struct Student *p1, *p2;
? ? int i;
?? ?system("cls");
?? ?for (i = 1;i < n + 1;i++) {
?? ??? ?p1 = (struct Student*)malloc(LEN);
?? ??? ?menu_print_in();
?? ??? ?scanf("%s %s %s %d %s %s %s %s %s %s", p1->num, p1->name, p1->sex,
?? ??? ??? ?&p1->age, p1->phone, p1->qq,p1->nativePlace,p1->department,p1->major,p1->className);
?? ??? ?p1->next = NULL;
?? ??? ?if (i == 1) {
?? ??? ??? ?head = p2 = p1;
?? ??? ?}
?? ??? ?else {
?? ??? ??? ?p2->next = p1;
?? ??? ??? ?p2 = p1;
?? ??? ?}
?? ?}
?? ?return(head);
}
?
/*數(shù)據(jù)存盤(wb只寫)*/
void WriteData_wb(struct Student *head) {
?? ?FILE *fp;
?? ?struct Student *p;
?? ?if ((fp = fopen(filename, "wb")) == NULL)
?? ??? ?printf("\a error! Can not open the file!");
?? ?p = head;
?? ?while (p != NULL) {
?? ??? ?if (fwrite(p, LEN, 1, fp) != 1) {
?? ??? ??? ?printf("寫入數(shù)據(jù)出錯\n");
?? ??? ??? ?fclose(fp);
?? ??? ??? ?return;
?? ??? ?}
?? ??? ?p = p->next;
?? ?}
?? ?fclose(fp);
}
?
/*數(shù)據(jù)存盤(ab追加)
void WriteData_ab(struct Student *head) {
?? ?FILE *fp;
?? ?struct Student *p;
?? ?if ((fp = fopen(filename, "ab")) == NULL)
?? ??? ?printf("\a error! Can not open the file!");
?? ?p = head;
?? ?while (p != NULL) {
?? ??? ?if (fwrite(p, LEN, 1, fp) != 1) {
?? ??? ??? ?printf("寫入數(shù)據(jù)出錯\n");
?? ??? ??? ?fclose(fp);
?? ??? ??? ?return;
?? ??? ?}
?? ??? ?p = p->next;
?? ?}
?? ?fclose(fp);
}
/*讀取數(shù)據(jù)*/
/*讀取數(shù)據(jù)文件保存到鏈表中 ,返回指向此鏈表頭指針*/
struct Student *ReadData(void) {
?? ?struct Student *head = NULL;
?? ?struct Student *p1, *p2;//s = p1;p = p2;
?
?? ?FILE *fp;
?? ?if ((fp = fopen(filename, "rb+")) == NULL)
?? ?{
?? ??? ?printf("打開文件出錯\n");
?? ??? ?exit(0);
?? ?}
?? ?while (!feof(fp)) {
?? ??? ?if ((p1 = (struct Student*)malloc(LEN)) == NULL) {
?? ??? ??? ?printf("內(nèi)存申請出錯\n");
?? ??? ??? ?fclose(fp);
?? ??? ??? ?exit(0);
?? ??? ?}
?? ??? ?if (fread(p1, LEN, 1, fp) != 1) {
?? ??? ??? ?free(p1);
?? ??? ??? ?break;
?? ??? ?}
?? ??? ?if (head == NULL)
?? ??? ??? ?head = p2 = p1;
?? ??? ?else {
?? ??? ??? ?p2->next = p1;
?? ??? ??? ?p2 = p1;
?? ??? ?}
?? ?}
?? ?fclose(fp);
?? ?return (head);
}
?
/*【1】全量查詢*/
void Print_inquire_all(void) {
?? ?void menu_print_out(void);
?? ?struct Student *pt;
?? ?pt = ReadData();
?? ?menu_print_out();
?? ?do {
?? ??? ?printf("%-10s%6s%8s%4d%13s%11s ?%s %s %s %s\n",
?? ??? ??? ?pt->num, pt->name, pt->sex, pt->age, pt->phone, pt->qq, pt->nativePlace, pt->department, pt->major, pt->className);
?? ??? ?pt = pt->next;
?? ?} while (pt != NULL);
?? ?printf("\n\n");
}
?
/*【2】學號查詢*/
int Print_inquire_num() {
?? ?void menu_print_out(void);
?? ?struct Student *pt;
?? ?char str_num[10];
?? ?printf("◎請輸入您要查詢的學號:");
?? ?scanf("%s", str_num);
?? ?pt = ReadData();
?? ?menu_print_out();
?? ?do {
?? ??? ?if (strcmp(pt->num, str_num) == 0) {
?? ??? ??? ?printf("%-10s%6s%8s%4d%13s%11s %s %s %s %s\n",
?? ??? ??? ??? ?pt->num, pt->name, pt->sex, pt->age, pt->phone, pt->qq, pt->nativePlace, pt->department, pt->major, pt->className);
?? ??? ??? ?printf("\n\n");
?? ??? ??? ?return 0;
?? ??? ?}
?? ??? ?pt = pt->next;
?? ?} while (pt != NULL);
?? ?printf("數(shù)據(jù)庫中沒有存儲您要查詢的數(shù)據(jù)!\n");
?? ?printf("\n\n");
?? ?return 0;
}
?
/*【3】姓名查詢*/
int Print_inquire_name() {
?? ?void menu_print_out(void);
?? ?struct Student *pt;
?? ?char str_name[20];
?? ?printf("◎請輸入您要查詢的姓名:");
?? ?scanf("%s", str_name);
?? ?pt = ReadData();
?? ?menu_print_out();
?? ?do {
?? ??? ?if (strcmp(pt->name, str_name) == 0) {
?? ??? ??? ?printf("%-10s%6s%8s%4d%13s%11s ?%s %s %s %s\n",
?? ??? ??? ??? ?pt->num, pt->name, pt->sex, pt->age, pt->phone, pt->qq, pt->nativePlace, pt->department, pt->major, pt->className);
?? ??? ??? ?printf("\n\n");
?? ??? ??? ?return 0;
?? ??? ?}
?? ??? ?pt = pt->next;
?? ?} while (pt != NULL);
?? ?printf("數(shù)據(jù)庫中沒有存儲您要查詢的數(shù)據(jù)!\n");
?? ?printf("\n\n");
?? ?return 0;
}
?
/*【4】模糊查詢*/
int Print_inquire_fuzzy(void) {
?? ?void menu_print_out(void);
?? ?struct Student *pt;
?? ?char str_find[20];
?? ?int m = 0;
?? ?printf("◎請輸入您要查詢的關(guān)鍵詞:");
?? ?scanf("%s", str_find);
?? ?pt = ReadData();
?? ?menu_print_out();
?? ?do {
?? ??? ?if (strstr(pt->num, str_find) != 0 || strstr(pt->name, str_find) != 0
?? ??? ??? ?|| strstr(pt->sex, str_find) != 0 || strstr(pt->phone, str_find) != 0
?? ??? ??? ?|| strstr(pt->qq, str_find) != 0) {
?? ??? ??? ?printf("%-10s%6s%8s%4d%13s%11s %s %s %s %s\n",
?? ??? ??? ??? ?pt->num, pt->name, pt->sex, pt->age, pt->phone, pt->qq, pt->nativePlace, pt->department, pt->major, pt->className);
?? ??? ??? ?m = 1;
?? ??? ?}
?? ??? ?pt = pt->next;
?? ?} while (pt != NULL);
?? ?if (!m)
?? ??? ?printf("數(shù)據(jù)庫中沒有存儲您要查詢的數(shù)據(jù)!\n");
?? ?printf("\n\n");
?? ?return 0;
}
?
/*【1】修改數(shù)據(jù)之刪除記錄*/
int Delete() {
?? ?struct Student *pt1, *pt2, *head;
?? ?char str_num[20];
?? ?printf("\n◎請輸入您要刪除的學號信息:");
?? ?scanf("%s", str_num);
?? ?pt1 = ReadData();
?? ?pt2 = pt1->next;
?? ?head = pt1;
?? ?while (pt2 != NULL) {
?? ??? ?if (strcmp(pt1->num, str_num) == 0) {
?? ??? ??? ?WriteData_wb(pt2);
?? ??? ?}
?? ??? ?else if (strcmp(pt2->num, str_num) == 0) {
?? ??? ??? ?pt1->next = pt2->next;
?? ??? ??? ?WriteData_wb(head);
?? ??? ?}
?? ??? ?pt2 = pt2->next;
?? ??? ?pt1 = pt1->next;
?? ?}
?? ?if (pt2 != NULL)
?? ??? ?printf("數(shù)據(jù)庫中沒有存儲您要刪除的數(shù)據(jù)!\n");
?? ?printf("\n\n");
?? ?return 0;
}
?
/*【2】修改數(shù)據(jù)之修改記錄*/
int Amend() {
?? ?void menu_print_in(void);
?? ?struct Student *pt1, *pt2, *head;
?? ?char str_num[20];
?? ?printf("◎請輸入您要修改的學號信息:");
?? ?scanf("%s", str_num);
?? ?pt1 = ReadData();
?? ?pt2 = pt1->next;
?? ?head = pt1;
?? ?while (pt2 != NULL) {
?? ??? ?if (strcmp(pt1->num, str_num) == 0) {
?? ??? ??? ?menu_print_in();
?? ??? ??? ?scanf("%s %s %s %d %s %s %s %s %s %s", pt1->num, pt1->name, pt1->sex,
?? ??? ??? ??? ?&pt1->age, pt1->phone, pt1->qq, pt1->nativePlace, pt1->department, pt1->major, pt1->className);
?? ??? ??? ?WriteData_wb(head);
?? ??? ?}
?? ??? ?else if (strcmp(pt2->num, str_num) == 0) {
?? ??? ??? ?menu_print_in();
?? ??? ??? ?scanf("%s %s %s %d %s %s %s %s %s %s", pt2->num, pt2->name, pt2->sex,
?? ??? ??? ??? ?&pt2->age, pt2->phone, pt2->qq, pt2->nativePlace, pt2->department, pt2->major, pt2->className);
?? ??? ??? ?WriteData_wb(head);
?? ??? ?}
?? ??? ?pt2 = pt2->next;
?? ??? ?pt1 = pt1->next;
?? ?}
?? ?if (pt2 != NULL)
?? ??? ?printf("數(shù)據(jù)庫中沒有存儲您要刪除的數(shù)據(jù)!\n");
?? ?return 0;
}
?
/*【3】修改數(shù)據(jù)之整理數(shù)據(jù)*/
int Neaten() {
?? ?struct Student *first;
?? ?struct Student *tail;
?? ?struct Student *p_min;
?? ?struct Student *min;
?? ?struct Student *p;
?? ?struct Student *head;
?? ?head = ReadData();
?? ?first = NULL;
?? ?while (head != NULL) {
?? ??? ?for (p = head, min = head; p->next != NULL; p = p->next) {
?? ??? ??? ?if (strcmp(p->next->num, min->num) < 0) {
?? ??? ??? ??? ?p_min = p;
?? ??? ??? ??? ?min = p->next;
?? ??? ??? ?}
?? ??? ?}
?? ??? ?if (first == NULL) {
?? ??? ??? ?first = min;
?? ??? ??? ?tail = min;
?? ??? ?}
?? ??? ?else {
?? ??? ??? ?tail->next = min;
?? ??? ??? ?tail = min;
?? ??? ?}
?? ??? ?if (min == head) {
?? ??? ??? ?head = head->next;
?? ??? ?}
?? ??? ?else {
?? ??? ??? ?p_min->next = min->next;
?? ??? ?}
?? ?}
?? ?if (first != NULL) {
?? ??? ?tail->next = NULL;
?? ?}
?? ?head = first;
?
?? ?WriteData_wb(head);
?? ?return 0;
}
?
/*輸入寫入數(shù)據(jù)的數(shù)量*/
int Creat_num(void) {
?? ?int n;
?? ?printf("\n◎請輸入您此次要添加的數(shù)據(jù)個數(shù):");
?? ?
?? ?if (scanf("%d", &n) != 1) {
?? ??? ?printf("\a error!");
?? ?}
?? ?return n;
}
?
/*選擇將要打開的文件*/
int File_name() {
?? ?printf("\n◎請輸入您想要打開的文件:");
?? ?if (scanf("%s", filename) != 1)
?? ??? ?printf("\a error!");
?? ?return 0;
}
?
/*主菜單*/
void menu(void) {
?? ?void menu_add(void);
?? ?void menu_inquire(void);
?? ?void menu_amend(void);
?? ?int a = 0;
?? ?printf(" ? ? ? ? ? ? ?╭════════╮ ? ? ? ? ? ? ?\n");
?? ?printf("╭══════╣學生管理系統(tǒng)V1.0╠══════╮\n");
?? ?printf("║ ? ? ? ? ? ?╰════════╯ ? ? ? ? ? ?║\n");
?? ?printf("║ ? 【1】添加數(shù)據(jù) ? ? ? ? ? 【3】修改數(shù)據(jù) ? ?║\n");
?? ?printf("║ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?║\n");
?? ?printf("║ ? 【2】查詢數(shù)據(jù) ? ? ? ? ? 【4】退出系統(tǒng) ? ?║\n");
?? ?printf("║ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?║\n");
?? ?printf("╰══════════════════════╯\n");
?? ?printf("◎請輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?
?? ?
?? ?a = getchar();
?
?? ?while (a != '1'&&a != '2'&&a != '3'&&a != '4') {
?? ??? ?printf("error! please input the right number!\n");
?? ??? ?putchar('\a');
?? ??? ?getchar();
?? ??? ?printf("◎請重新輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?? ??? ?a = getchar();
?? ?}
?? ?switch (a) {
?? ?case '1': File_name();menu_add();
?? ??? ?break;
?? ?case '2': File_name();menu_inquire();
?? ??? ?break;
?? ?case '3': File_name();menu_amend();
?? ??? ?break;
?? ?case '4': exit(0);
?? ??? ?break;
?? ?}
?? ?getchar();
}
?
/*二級菜單之添加數(shù)據(jù)*/
void menu_add(void) {
?? ?int a = 0;
?? ?system("cls");
?? ?getchar();
?? ?printf(" ? ? ? ? ? ? ?╭════════╮ ? ? ? ? ? ? ?\n");
?? ?printf("╭══════╣ ?添加數(shù)據(jù)方式 ?╠══════╮\n");
?? ?printf("║ ? ? ? ? ? ?╰════════╯ ? ? ? ? ? ?║\n");
?? ?printf("║ 【1】新建文件 【2】增添數(shù)據(jù) 【3】返回菜單 ?║\n");
?? ?printf("║ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?║\n");
?? ?printf("╰══════════════════════╯\n");
?? ?printf("◎請輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?
?? ?
?? ?a = getchar();
?
?? ?while (a != '1'&&a != '2'&&a != '3') {
?? ??? ?printf("error! please input the right number!\n");
?? ??? ?putchar('\a');
?? ??? ?getchar();
?? ??? ?printf("◎請重新輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?? ??? ?a = getchar();
?? ?}
?? ?switch (a) {
?? ?case '1': WriteData_wb(Creat(Creat_num()));
?? ??? ?printf("\n◎新建文件成功且數(shù)據(jù)已成功保存◎\n");
?? ??? ?system("pause");
?? ??? ?system("cls");
?? ??? ?menu_add();
?? ??? ?break;
?? ?case '2': WriteData_ab(Creat(Creat_num()));
?? ??? ?printf("\n◎數(shù)據(jù)已成功添加◎\n");
?? ??? ?system("pause");
?? ??? ?system("cls");
?? ??? ?menu_add();
?? ??? ?break;
?? ?case '3': system("cls");
?? ??? ?getchar();
?? ??? ?menu();
?? ??? ?break;
?? ?}
}
?
/*二級菜單之查詢數(shù)據(jù)*/
void menu_inquire(void) {
?? ?int a = 0;
?? ?system("cls");
?? ?getchar();
?? ?while (1) {
?? ??? ?system("cls");
?? ??? ?printf(" ? ? ? ? ? ? ?╭════════╮ ? ? ? ? ? ? ?\n");
?? ??? ?printf("╭══════╣ ?查詢數(shù)據(jù)方式 ?╠══════╮\n");
?? ??? ?printf("║ ? ? ? ? ? ?╰════════╯ ? ? ? ? ? ?║\n");
?? ??? ?printf("║ ? ?【1】全量查詢 ? ? ? ? 【4】模糊查詢 ? ? ║\n");
?? ??? ?printf("║ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?║\n");
?? ??? ?printf("║ ? ?【2】學號查詢 ? ? ? ? 【5】返回菜單 ? ? ║\n");
?? ??? ?printf("║ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?║\n");
?? ??? ?printf("║ ? ?【3】姓名查詢 ? ? ? ? ? ? ? ? ? ? ? ? ? ║\n");
?? ??? ?printf("╰══════════════════════╯\n");
?? ??? ?printf("◎請輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?? ??? ?
?? ??? ?a = getchar();
?
?? ??? ?while (a != '1'&&a != '2'&&a != '3'&&a != '3'&&a != '4'&&a != '5'&&a != '6') {
?? ??? ??? ?printf("error! please input the right number!\n");
?? ??? ??? ?putchar('\a');
?? ??? ??? ?getchar();
?? ??? ??? ?printf("◎請重新輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?? ??? ??? ?a = getchar();
?? ??? ?}
?? ??? ?switch (a) {
?? ??? ?case '1': Print_inquire_all();system("pause");getchar();
?? ??? ??? ?break;
?? ??? ?case '2': Print_inquire_num();system("pause");getchar();
?? ??? ??? ?break;
?? ??? ?case '3': Print_inquire_name();system("pause");getchar();
?? ??? ??? ?break;
?? ??? ?case '4': Print_inquire_fuzzy();system("pause");getchar();;
?? ??? ??? ?break;
?? ??? ?case '5': system("cls");getchar();menu();
?? ??? ??? ?break;
?? ??? ?}
?? ?}
}
?
/*二級菜單之修改數(shù)據(jù)*/
void menu_amend(void) {
?? ?int a = 0;
?? ?system("cls");
?? ?getchar();
?? ?while (1) {
?? ??? ?system("cls");
?? ??? ?printf(" ? ? ? ? ? ? ?╭════════╮ ? ? ? ? ? ? ?\n");
?? ??? ?printf("╭══════╣ ?修改數(shù)據(jù)方式 ?╠══════╮\n");
?? ??? ?printf("║ ? ? ? ? ? ?╰════════╯ ? ? ? ? ? ?║\n");
?? ??? ?printf("║ ? ?【1】刪除記錄 ? ? ? ? ?【3】整理數(shù)據(jù) ? ?║\n");
?? ??? ?printf("║ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?║\n");
?? ??? ?printf("║ ? ?【2】修改記錄 ? ? ? ? ?【4】返回菜單 ? ?║\n");
?? ??? ?printf("╰══════════════════════╯\n");
?? ??? ?printf("◎請輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?
?? ??? ?
?? ??? ?a = getchar();
?
?? ??? ?while (a != '1'&&a != '2'&&a != '3'&&a != '4') {
?? ??? ??? ?printf("error! please input the right number!\n");
?? ??? ??? ?putchar('\a');
?? ??? ??? ?getchar();
?? ??? ??? ?printf("◎請重新輸入功能前的序號進入相應的工具:【 ? 】\b\b");
?? ??? ??? ?a = getchar();
?? ??? ?}
?? ??? ?switch (a) {
?? ??? ?case '1': Delete();
?? ??? ??? ?printf("\n\n◎已成功刪除指定數(shù)據(jù)◎\n");
?? ??? ??? ?system("pause");
?? ??? ??? ?getchar();
?? ??? ??? ?break;
?? ??? ?case '2': Amend();
?? ??? ??? ?printf("\n\n◎已成功修改指定數(shù)據(jù)◎\n");
?? ??? ??? ?system("pause");
?? ??? ??? ?getchar();
?? ??? ??? ?break;
?? ??? ?case '3': Neaten();
?? ??? ??? ?printf("\n\n◎數(shù)據(jù)已成功按照學號重新排列◎\n");
?? ??? ??? ?system("pause");
?? ??? ??? ?getchar();
?? ??? ??? ?break;
?? ??? ?case '4': system("cls");
?? ??? ??? ?getchar();
?? ??? ??? ?menu();
?? ??? ??? ?break;
?? ??? ?}
?? ?}
}
?
/*輸入輸出提示欄*/
void menu_print_in(void) {
?? ?printf("------------------------------------------------------------------------\n");
?? ?printf("學號 ? ? ?姓名 ? ? 性別 ?年齡 ? ?電話 ? ? ? ? QQ ? ? ? ?籍貫 ?系別 ?專業(yè) ?班級 ? \n");
?? ?printf("------------------------------------------------------------------------\n");
}
void menu_print_out(void) {
?? ?printf("--------------------------------------------------------------------------\n");
?? ?printf("學號 ? ? ?姓名 ? ? 性別 ?年齡 ? ?電話 ? ? ? ? QQ ? ? ? ?籍貫 ?系別 ?專業(yè) ?班級 \n");
?? ?printf("--------------------------------------------------------------------------\n");
}
?
/*主函數(shù)*/
int main(void) {
?? ?SetConsoleTitle(L"學生學籍管理系統(tǒng)");
?? ?menu();
?? ?return 0;
}

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 枚舉窗口句柄后關(guān)閉所有窗口示例

    枚舉窗口句柄后關(guān)閉所有窗口示例

    這篇文章主要介紹了關(guān)閉所有窗口的方法,原理是枚舉所有窗口句柄,然后發(fā)送WM_CLOSE消息來關(guān)閉窗口,需要的朋友可以參考下
    2014-01-01
  • C語言單循環(huán)鏈表的表示與實現(xiàn)實例詳解

    C語言單循環(huán)鏈表的表示與實現(xiàn)實例詳解

    這篇文章主要介紹了C語言單循環(huán)鏈表的表示與實現(xiàn),對于學習數(shù)據(jù)結(jié)構(gòu)與算法的朋友來說很有參考借鑒價值,需要的朋友可以參考下
    2014-07-07
  • C++小游戲tankwar之界面繪制的詳細過程

    C++小游戲tankwar之界面繪制的詳細過程

    最近沒有項目做,空閑了下來,于是寫了個c++小游戲來打發(fā)時間,下面通過本文基于圖文并茂的形式給大家介紹C++小游戲tankwar之界面繪制的詳細過程,感興趣的朋友一起看看吧
    2021-05-05
  • C++深入探究類與對象之對象模型與this指針使用方法

    C++深入探究類與對象之對象模型與this指針使用方法

    C++對象模型中只有類的非static成員以及一個指向虛函數(shù)表的指針被配置于類對象內(nèi),其他都在類對象外,在 C++ 中,每一個對象都能通過 this 指針來訪問自己的地址。this 指針是所有成員函數(shù)的隱含參數(shù)。因此,在成員函數(shù)內(nèi)部,它可以用來指向調(diào)用對象
    2022-04-04
  • 深入聊聊C語言中的Const關(guān)鍵字

    深入聊聊C語言中的Const關(guān)鍵字

    關(guān)鍵字const用來定義只讀變量,被const定義的變量它的值是不允許改變的,即不允許給它重新賦值,即使是賦相同的值也不可以,下面這篇文章主要給大家介紹了關(guān)于C語言中Const關(guān)鍵字的相關(guān)資料,需要的朋友可以參考下
    2022-02-02
  • c語言隨機數(shù)函數(shù)示例

    c語言隨機數(shù)函數(shù)示例

    這篇文章主要介紹了c語言隨機數(shù)函數(shù)示例,需要的朋友可以參考下
    2014-04-04
  • C/C++內(nèi)存泄漏原因分析與應對方法

    C/C++內(nèi)存泄漏原因分析與應對方法

    內(nèi)存泄漏會導致當前應用程序消耗更多的內(nèi)存,使得其他應用程序可用的內(nèi)存更少了,那么為什么會內(nèi)存泄漏,我們應該怎樣應對內(nèi)存泄漏,所以接下來就給大家詳細介紹一下C++內(nèi)存泄漏原因分析與應對方法,需要的朋友可以參考下
    2023-07-07
  • C++中的單例模式介紹

    C++中的單例模式介紹

    單例模式也稱為單件模式、單子模式,可能是使用最廣泛的設計模式。其意圖是保證一個類僅有一個實例,并提供一個訪問它的全局訪問點,該實例被所有程序模塊共享
    2013-03-03
  • C語言三子棋小游戲?qū)崿F(xiàn)全程

    C語言三子棋小游戲?qū)崿F(xiàn)全程

    三子棋是一種民間傳統(tǒng)游戲,又叫九宮棋、圈圈叉叉、一條龍、井字棋等。將正方形對角線連起來,相對兩邊依次擺上三個雙方棋子,只要將自己的三個棋子走成一條線,對方就算輸了,想用c語言做出這個游戲,事實上也是比較簡單的,下面通過c語言進行對五子棋的分析
    2022-05-05
  • C++實現(xiàn)水仙花數(shù)判斷實例

    C++實現(xiàn)水仙花數(shù)判斷實例

    大家好,本篇文章主要講的是C++實現(xiàn)水仙花數(shù)判斷實例,感興趣的同學趕快來看一看吧,對你有幫助的話記得收藏一下,方便下次瀏覽
    2022-01-01

最新評論

绍兴县| 时尚| 封丘县| 上饶市| 平遥县| 浙江省| 冕宁县| 桑植县| 恩施市| 景德镇市| 南城县| 舟山市| 乌兰县| 娄烦县| 惠东县| 安阳市| 芮城县| 岚皋县| 阿巴嘎旗| 广河县| 沽源县| 勐海县| 黄陵县| 吉林省| 洞头县| 福泉市| 运城市| 闻喜县| 泉州市| 西昌市| 正安县| 疏勒县| 会宁县| 唐山市| 信宜市| 宁阳县| 仪陇县| 屏南县| 秭归县| 珲春市| 南充市|