Type of array index in C++

后端 未结 4 1343
甜味超标
甜味超标 2020-12-06 16:35

What is the type of array index in C++ programming language? For example in such statement:

int tab[5];

To what type 5 is converted? or may

4条回答
  •  不知归路
    2020-12-06 16:38

    This is int if you wanta different type use sufix, for example:

    5         // int
    5u        // unsigned int
    5l        // long
    5ul       // unsigned long 
    

提交回复
热议问题