f(int a, int b) { int a; a = 20; return a; } Point out a error of the following program

f(int a, int b)

{

int a;

a = 20;

return a;

}

Point out a error of the following program

A. Missing parenthesis in return statement

B. The function should be defined as int f(int a, int b)

C. Re-declaration of a

D. None of above

Hướng dẫn

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

Xem lời giải

Xem lời giải

Hàm được định nghĩa chưa có kiểu trả về. Một số chương trình biên dịch sẽ không chấp nhận điều này.

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 3:02 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