为什么int8_t被读作一个字符?

时间:2017-01-09 15:27:01

标签: c++

我想将一些小整数放入数组中并决定使用int8_t

#include <cstdint>
#include <iostream>

int main() {
    int n = 3;
    int8_t arr[n];
    for (int i = 0; i < n; ++i) {
        std::cin >> arr[i];
    }
}

输入为9 -20 14n = 3

但我在数组中没有9, -20, 14,而是9, -, 2

int8_t为什么表现得像char

P.S。 int8_tsys/types.h方式输入# define __intN_t(N, MODE) \ typedef int int##N##_t __attribute__ ((__mode__ (MODE))) # ifndef __int8_t_defined # define __int8_t_defined __intN_t (8, __QI__); # endif

let wait = SKAction.wait(forDuration: 1.0)
let incrementScoreAction = SKAction.run {
   //code to increment score
}

let repeatIncrementScore = SKAction.repeatForever(SKAction.sequence([wait, incrementScoreAction]))

self.run(repeatIncrementScore)

0 个答案:

没有答案