0

型 unsigned integer * (std::size_t としても定義) のポインターを long long * であると予想される MKL 関数に渡したいのですが、どちらも 64 ビット整数ですが、型の非互換性エラーが発生します。64 ビット整数モードで MKL を使用します。助けはありますか?ありがとう

4

1 に答える 1

0
#include <limits.h>

int main() {
    unsigned int i = UINT_MAX;
    unsigned int iptr = &i

    // In writing this, I realized that you have to change the original 
    // or declare a new llong, but remember that 
    // returning a pointer to a local is bad.  Change the original if you can.
    if(i > LLONG_MAX) i = LLONG_MAX;
    long long *lptr = (long long *)i;
}
于 2011-09-01T15:48:55.753 に答える