zoukankan      html  css  js  c++  java
  • 关于数组传递的错误

    unsigned char* getDirectionGray( unsigned char** ptrCenterRow, int j)
    {
        unsigned char p[4]; //如果修改成*p则出现段错误,还没搞懂
    
        p[0] = abs(ptrCenterRow[-1][(j-1)] -ptrCenterRow[0][j]) +
                            abs(ptrCenterRow[1][(j+1)]-ptrCenterRow[0][j]);   
        cout << "d0:" << p[0] <<  endl;
        printf("%d
    ", p[0]);
        p[1] = abs(ptrCenterRow[-1][j]-ptrCenterRow[0][j])+
                            abs(ptrCenterRow[1][j]-ptrCenterRow[0][j]);
        cout << "d1:" << p[1] << endl;
        printf("%d
    ", p[1]);
        p[2] = abs(ptrCenterRow[1][(j+1)]-ptrCenterRow[0][j]) + 
                            abs(ptrCenterRow[1][(j-1)]-ptrCenterRow[0][j]);
        cout << "d2:" << p[2] << endl;
        printf("%d
    ", p[2]);
        p[3] = abs(ptrCenterRow[0][(j-1)]-ptrCenterRow[0][j]) + 
                            abs(ptrCenterRow[0][(j+1)] - ptrCenterRow[0][j]);
        cout << "d3:" << p[3] << endl;
        printf("%d
    ", p[3]);
        cout << "getDirectionGray()" << endl;
        return p;
    
    }
    The Safest Way to Get what you Want is to Try and Deserve What you Want.
  • 相关阅读:
    5.Java 线程状态之 TIMED_WAITING
    3.Java 线程状态之 BLOCKED
    4.Java 线程状态之 WAITING
    2.Java 线程状态之 RUNNABLE
    1.关于Java的线程状态
    js注入,canvas截图
    node使用3
    node使用2
    node的使用1
    学习进度报告
  • 原文地址:https://www.cnblogs.com/Shinered/p/10494922.html
Copyright © 2011-2022 走看看