我想将一个无符号整数*(也定义为std :: size_t)类型的指针传递给MKL函数,该函数期望它长很长*,虽然两者都是64位整数,但我得到类型不兼容错误。我在64位整数模式下使用MKL。有帮助吗? 谢谢
答案 0 :(得分: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;
}