更新时间2022-03-17 16:38:54
设有以下程序段: char str[4][10]={“frist”,”second”,”third”,”forurth”},*strp[4]; int n; for(n=0;n<4;n++) strp[n]=str[n]; 若k为int型变量且0<=k<4,则对字符串的不正确引用是( )A strp B *strp 这两个怎么区分
strp 是个指针数组,也相当于一个二级指针
对上面的程序,最终
strp[0]=“frist”
strp[1] = "second"
strp[2] = "third"
strp[3] = "forurth"
而
*strp 就是个一维指针了,它指向的是strp[0],也就是它与strp[0]的值是相等的,就是“frist”