const static 统一定义buffer大小

发布时间 2023-12-30 04:38:47作者: lydstory
#include <iostream>
#include <string>
using namespace std;

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

typedef uint32_t u32;
typedef uint8_t u8;
typedef uint16_t u16;


const static int BUF_LEN_1 = 1;
const static int BUF_LEN_8 = 8;
const static int BUF_LEN_20 = 20;
const static int BUF_LEN_33 = 33;
const static int BUF_LEN_64 = 64;
const static int BUF_LEN_128 = 128;
const static int BUF_LEN_256 = 256;
const static int BUF_LEN_512 = 512;
const static int BUF_LEN_1024 = 1024;
const static int BUF_LEN_4096 = 4096;

int main()
{
  cout << "hello,world" << endl;
  cout << "ni hao " <<endl;
  char buf[BUF_LEN_128];

  cout << sizeof(buf)<<endl;
  return 0;
}