共 77 篇文章 |
|
size_type与 size_t一些概念由string类类型和vector类类型定义的类型,用以保存任意string对象或vector对象的长度,标准库类型将size_type定义为unsigned类型。为而来使用由string类型定义的size_type类型。一点注意:虽然是在学习标准库string的时候巧遇了size_type类型,但是,其实vector库也可以定义size_type类型,在vector库中还有一个dif... 阅100 转0 评0 公众公开 18-08-16 15:44 |
阅20 转0 评0 公众公开 18-07-07 14:20 |
阅28 转0 评0 公众公开 18-07-06 14:29 |
阅63 转0 评0 公众公开 18-07-01 12:28 |
阅16 转0 评0 公众公开 18-06-29 11:17 |
280 f0814#include<iostream>#include<string>using namespace std;class student{static int number;public:void set(string str){name = str;}static void printNumber(){cout <<number <<"total number\n" <<endl;}void print(){cout <<name <<"-> students are "<<... 阅21 转0 评0 公众公开 18-06-28 10:45 |
274main.cpp#include"ppoint.h"#include<iostream>using namespace std;}ppoint.cpp#include"ppoint.h"#include<cmath>using namespace std;void ppoint::set(double a, double b){x = a;}double ppoint::xoffset(){return x;}double ppoint::yoffset(){return y;}double ppoint::radius(){return (x*x + y * ... 阅91 转0 评0 公众公开 18-06-27 10:24 |
//全局变量void func();void main(){int a = 1;int b = 1;cout <<a <<" "<<b <<" "<<n <<endl;func();cout <<a <<" "<<b <<" "<<n <<endl;func(); system("pause");}void func(){static int a = 2;int b = 3;a ... 阅34 转0 评0 公众公开 18-06-24 12:29 |
阅36 转0 评0 公众公开 18-06-23 15:38 |
阅26 转0 评0 公众公开 18-06-23 15:19 |