随便写了下,应该就这样吧..
有错误请指出...
    static void MYFUNCTION(ref byte pcs, ref short pwd, int len, ref byte bypmo)
    {
        int i;
        if (pcs == 0 || pwd == 0 || len <= 0) return;
        for (i = 0; i < len; i++, pcs++, pwd++)
        {
            pwd = (short)(((pcs - 128) << bypmo));
        }
        return;
    }

解决方案 »

  1.   

    只有  pwd 需要 ref    static void MYFUNCTION(byte[] pcs, ref short[] pwd, int len,byte bypmo)
        {
            int i;
            if (pcs.Length == 0  ¦ ¦ pwd.Length == 0  ¦ ¦ len  <= 0) return;
            for (i = 0; i  < len; i++)
            {
                pwd[i] = (short)(((pcs[i]-128) << bypmo));
            }
            return;
        }
      

  2.   

    学习整理一下,一直对C的东西比较困惑.
    unsigned char *pcs   -->    byte[]  pcs 
    short * pwd          --->   ref short[] pwd
    unsigned char byPmo  --->   byte bypmo
      

  3.   

    cao,鄙视这种垃圾题目,没本事,不回答,近来晃悠一下,签个名
    ==================================================================
    博客空间:http://blog.csdn.net/lovingkiss
    资源下载:http://download.csdn.net/user/lovingkiss
    Email:loving-kiss@163.com
    优惠接单开发,组件控件定制开发,成品源代码批发
    联系方式:Q66840199  全天在线
    ==================================================================
      

  4.   

    也可以unsigned char *pcs   -- >    char[]  pcs  char *pcs 是指向一个字符串的起始位置的指针,在C++里面没有直接处理字符串的类型,字符串是用数组实现的