void main() { char str[] = {“pvpit”}; char *s1 = str; s1++; printf(“%c”, *s1); getch(); } What is output?

void main()

{

char str[] = {“pvpit”};

char *s1 = str;

s1++;

printf(“%c”, *s1);

getch();

}

What is output?

A. pvpit

B. vpit

C. v

D. Another

Hướng dẫn

Chọn C là đáp án đúng

Xem lời giải

Xem lời giải

s1 = str, s1 trỏ tới phần tử đầu tiên của chuỗi “pvpit”. s1++, s1 trỏ tới phần tử thứ 2 của chuỗi “pvpit”. *s1 = ‘v’.

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 3:09 chiều

Đánh giá chủ đề này
How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site