2008-09-01から1日間の記事一覧

C++の目次

C++

学習Tips gccでC++ クラス 基本 コンストラクタ いろいろ enum

構造体

メンバに同じ型へのポインタを持つ #include <stdio.h> typedef struct STUDENT{ char *name; int age; struct STUDENT *next; }DATA; int main(void){ DATA taro = {"TARO", 16}; DATA jiro = {"JIRO", 15}; DATA hana = {"HANA", 14}; DATA *p; taro.next = &jiro; </stdio.h>…

構造体

typedefを使う #include <stdio.h> typedef struct STUDENT{ char *name; int age; }MYDATA; void SirYesSir(MYDATA *); int main(void){ MYDATA taro; MYDATA *p; p = &taro; taro.name = "TARO"; taro.age = 22; printf("%s - %d\n", taro.name, taro.age); SirYesS</stdio.h>…