Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> การเขียนโปรแกรม C

An Uncommon representation of array elements in C/C++


นี่คือ C++ program แสดง uncommon representation ของ array elements

#include<iostream> using namespace std; int main() { int array[5] = {7,7,7, 6, 6}; for (int i = 0; i < 5; i++) cout<<*(array+i); return 0; }

ผลลัพธ์

7 7 7 6 6