when i am making the coding, i met the follows problem.cannot convert parameter 5 from 'unsigned long *' to 'unsigned int *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style castwho can help me do this? i am idiot in it. i need your help!

解决方案 »

  1.   

    不能将无符号长整型变量指针转型为无符号短整变量指针,因为long是16位变量,int是8位变量,显而易见16位转为8 位会造成数据丢失,如果你一定要转的话, 要用强制转换如(unsigned int*)p
    你的函数调用的参数有问题
    把你的代码贴出来看看
      

  2.   

    "long是16位变量,int是8位变量" ???????????在VC6中long和int 都是32位的。楼主所需的仅仅是强制转换而已。
      

  3.   

    强制类型转换就行了
    int *a;
    long *b;
    a=(long *)&b;
      

  4.   

    是呀,long和int在VC6中都是一样的,强制转化就可以了
      

  5.   

    强制类型转换就行了
    int *a;
    long *b;
    a=(long *)&b;