在Xcode中调试视图

时间:2017-01-09 01:54:28

标签: xcode

当我在Xcode中调试时,如何添加图片1的视图( main() )和图片2的视图( sort() )同时?或者我如何在函数中调试时看到数组中的值: a [10] sort()

图片1( main() ):

picture1

图片2( sort() ):

enter image description here

图片3(全貌):

enter image description here

这是我的代码:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdbool.h>
#include <limits.h>
void swap(int* a, int* b){
    int temp;
    temp=*a;
    *a=*b;
    *b=temp;
}

void sort(int* a, int l, int r){
    int i=0;
    if(l!=r){
        int change=l;
        int move = l+1;
        for(; move<r; move++){
            if(a[move]<a[l]){
                swap(&a[move], &a[++change]);
            }
        }

        swap(&a[l], &a[change]);
        if(change>l){
            sort(a, l, change-1);
        }
        if(change<r){
            sort(a, change+1, r);
        }
    }
}

int main(){
    int  a[10]={1,2,44,22,2,5,6,0,10,99};
    sort(a, 0, 9);
    int i;
    for(i=0; i<10; i++){
        printf("%d\n", a[i]);
    }
    int b=2, c=3;
    swap(&b,&c);

    printf("b is %d, c is %d", b, c);
    return 0;
}

0 个答案:

没有答案
相关问题