虚幻Unreal - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(87评价)
价格: 3149.00元

switch (vip) {

  case 0:

     break;

  case 1:

      不加break则会每次都走到这不跳出去

   case 2:

     break;

 

}

[展开全文]
simple7503 · 2021-06-02 · 0

宏  代表任意字符串

#define END return 0; 

#define START int main() 后面不需要加引号

类型别名

typedef string Ustring;后面必须加引号

[展开全文]
simple7503 · 2021-06-02 · 0

char str1[] = "sdf"

char str2[] = "sdf"

比较数组地址

str1 == str2

比较内容

strcamp(str1, str2)

0 相等 非零不等

 

比较string类型

string str1 = "sdf"

string str2 = "sdf"

直接 str1 == str2

[展开全文]
simple7503 · 2021-06-02 · 0

#include <array>

array<int , 9> a1 = {1,2,3};

[展开全文]
simple7503 · 2021-06-02 · 0

int* p = new int[20];

p[0] = 20;

delete[] p;

[展开全文]
simple7503 · 2021-06-02 · 0

int a[] = {1, 2, 3}

cout << a << endl;

cout << *a << endl; 值为1

cout << *(a+1) << endl;  值为2

*(a + 2) = 4;

a是个数组的首地址

a其实是个数组指针

[展开全文]
simple7503 · 2021-06-02 · 0

new申请的一定要手动delete释放

int* p = new int;

*p = 100;

delete p;

[展开全文]
simple7503 · 2021-06-02 · 0

int* p = nullptr;

void * p2; 任意类型的指针

p2 = &a;

cout << *((int*)p2) << endl;

[展开全文]
simple7503 · 2021-06-02 · 0

int* pa = &a;

float* pb = &b;

cout << *pa << endl;

[展开全文]
simple7503 · 2021-06-02 · 0

指针式对内存地址的操作

&+变量  &a 取得a的地址

*+地址  *a 取得地址a里面的值

[展开全文]
simple7503 · 2021-06-02 · 0

枚举类型就是整型

不赋值的话从0开始

赋值的话 从值开始自增1

enum HeroType {

  Tank = 2;

  ADC;

}

HeroType h1 = Tank;

[展开全文]
simple7503 · 2021-06-02 · 0

struct Hero {

  string name;

  int hp;

}

[展开全文]
simple7503 · 2021-06-02 · 0

struct Position {

   float x;

   float y;

}

Position p1 = {1,2}

Position p2{1,2};

[展开全文]
simple7503 · 2021-06-02 · 0

string s = "abcdefg"

string s3 = s1 + s2

getline(cin, s)

cout << s.size() << endl;

[展开全文]
simple7503 · 2021-06-02 · 0

cin 接受参数 按空格处理

想要接收多字符 包括空格

cin.geline(name, 20);

[展开全文]
simple7503 · 2021-06-02 · 0

char s[] = {'s', 'a', 'b', '\0'}

\0表示字符串结束

char s[] = "sab" 

自动添加\0

char s2[] = "sab1" "sab2"

 

[展开全文]
simple7503 · 2021-06-02 · 0

int array1[3] = {1, 2, 3}

int array2[] = {1, 2, 3, 4}

C++11 新方法

int array3[4]{1, 2, 3};

int array4[]{1, 2, 3}; 

[展开全文]
simple7503 · 2021-06-02 · 0

auto a = 'a';

[展开全文]
simple7503 · 2021-06-02 · 0

#include <climits>

float 

double

long double

cout << FLT_MAX << endl;

cout << FLT_MIN << endl;

[展开全文]
simple7503 · 2021-06-02 · 0

const int j = 90;

[展开全文]
simple7503 · 2021-06-02 · 0