課程
/后端開發
/C++
/C++遠征之繼承篇
c++頭文件及其包含的函數要知道多少?
2015-12-09
源自:C++遠征之繼承篇
正在回答
記得常用的就好,用的不多的留個印象,用的時候知道百度就好啊
#include<iostream.h> :cin>>... (輸入函數) ; ? cout<<...(輸出函數)
2
#include<stdlib.h> :(1)void exit(int)函數 ? 終止程序運行
? ? ? ? ? ? ? ? ? ? ?(2)int rand()函數 ? 能夠返回0~32767之間的隨機整數
? ? ? ? ? ? ? ? ? ? ?(3)rand()%n可以產生0~n-1 范圍的任意隨機整數
? ? ? ? ? ? ? ? ? ? ?(4)void* calloc(unsigned int n,unsigned int size)函數 ?
? ? ? ? ? ? ? ? ? ? ? ? ? 用來動態分配n個連續存儲位置;
? ? ? ? ? ? ? ? ? ? ?(5)void malloc(int size)函數 用來動態分配大小為size個字節
? ? ? ? ? ? ? ? ? ? ? ? ? 的存儲空間;
? ? ? ? ? ? ? ? ? ? ?(6)void realloc(int size) ?用來動態分配大小為size個字節
? ? ? ? ? ? ? ? ? ? ? ? ? 的"新"存儲空間;
? ? ? ? ? ? ? ? ? ? ?(7)void free(void *p) 釋放由參數p所指向的動態存儲空間
3
#include<string.h> 字符串操作的頭文件
? ? ? ? ? ? ? ? ?(1)int strlen(const char *s):求串長度
? ? ? ? ? ? ? ? ?(2) char strcpy(char *dest,const char *src) 串復制
? ? ? ? ? ? ? ? ?(3) ?... strcat(str1,str2) 串連接
? ? ? ? ? ? ? ? ?(4) ?... strcmp(str1,str2) 串比較
? ? ? ? ? ? ? ? ?(5) ?... strchr(str,字符) 串定位
? ? ? ? ? ? ? ? ?(6) ?... strrchr(str,字符) 串右 定位
? ? ? ? ? ? ? ? ?(7) ?... strstr(str1,str2) 串查找(在str1中找str2)
END
舉報
繼承,C++面向對象三大特征之一,通過編碼實踐方式講解到操作層面
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2015-12-10
記得常用的就好,用的不多的留個印象,用的時候知道百度就好啊
2015-12-09
#include<iostream.h> :cin>>... (輸入函數) ; ? cout<<...(輸出函數)
2
#include<stdlib.h> :(1)void exit(int)函數 ? 終止程序運行
? ? ? ? ? ? ? ? ? ? ?(2)int rand()函數 ? 能夠返回0~32767之間的隨機整數
? ? ? ? ? ? ? ? ? ? ?(3)rand()%n可以產生0~n-1 范圍的任意隨機整數
? ? ? ? ? ? ? ? ? ? ?(4)void* calloc(unsigned int n,unsigned int size)函數 ?
? ? ? ? ? ? ? ? ? ? ? ? ? 用來動態分配n個連續存儲位置;
? ? ? ? ? ? ? ? ? ? ?(5)void malloc(int size)函數 用來動態分配大小為size個字節
? ? ? ? ? ? ? ? ? ? ? ? ? 的存儲空間;
? ? ? ? ? ? ? ? ? ? ?(6)void realloc(int size) ?用來動態分配大小為size個字節
? ? ? ? ? ? ? ? ? ? ? ? ? 的"新"存儲空間;
? ? ? ? ? ? ? ? ? ? ?(7)void free(void *p) 釋放由參數p所指向的動態存儲空間
3
#include<string.h> 字符串操作的頭文件
? ? ? ? ? ? ? ? ?(1)int strlen(const char *s):求串長度
? ? ? ? ? ? ? ? ?(2) char strcpy(char *dest,const char *src) 串復制
? ? ? ? ? ? ? ? ?(3) ?... strcat(str1,str2) 串連接
? ? ? ? ? ? ? ? ?(4) ?... strcmp(str1,str2) 串比較
? ? ? ? ? ? ? ? ?(5) ?... strchr(str,字符) 串定位
? ? ? ? ? ? ? ? ?(6) ?... strrchr(str,字符) 串右 定位
? ? ? ? ? ? ? ? ?(7) ?... strstr(str1,str2) 串查找(在str1中找str2)
END