2010-08-02から1日間の記事一覧

構造体とメンバの透過性

Cプログラマのための C++入門 > 2.クラスの概念 > 構造体とメンバの透過性 C++ #include <stdio.h>struct student { char name[20]; int eng; int math; int ave; };void calc_ave(student* x) { x->ave = (x->eng + x->math) / 2; }int average(student* x) { return</stdio.h>…