1998-12-01から1ヶ月間の記事一覧

『明解C言語 入門編』in Delphi

『明解C言語 入門編』 in Delphi 柴田望洋『明解C言語 入門編』を Delphi で実装してみます。 1. まずは慣れよう 000.整数値 15 と 37 の和を表示する 001.整数値 15 から 37 を引いた値を表示する 002.整数値 15 と 37 の和を親切に表示する 003.2つの変…

ポインタのソート

明解C言語 入門編 > 12. 構造体 > ポインタのソート Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;const NINSU = 5;type TStudent = record name: array[0..19] of Char; height: Integer; weight: Real; end; PStudent = ^TStudent; TCharArr…

構造体の動的配列 (realloc)

明解C言語 入門編 > 12. 構造体 > 構造体の動的配列 (realloc) Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;const NINSU = 5;type TStudent = record name: array[0..19] of Char; height: Integer; weight: Real; end; TCompare = function …

構造体の動的配列 (malloc)

明解C言語 入門編 > 12. 構造体 > 構造体の動的配列 (malloc) Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;const NINSU = 5;type TStudent = record name: String; height: Integer; weight: Real; end;type TCompare = function (x:TStudent…

5人の学生を 身長・体重で ソート (関数ポインタ)

明解C言語 入門編 > 12. 構造体 > 5人の学生を 身長・体重で ソート (関数ポインタ) Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;const NINSU = 5;type TStudent = record name: String; height: Integer; weight: Real; end;type TCompare …

5人の学生を 身長で ソート (構造体)

明解C言語 入門編 > 12. 構造体 > 5人の学生を 身長で ソート (構造体) Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;const NINSU = 5;type TStudent = record name: String; height: Integer; weight: Real; end;procedure swap(var x:TStud…

構造体を返す関数

明解C言語 入門編 > 12. 構造体 > 構造体を返す関数 Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;type TStudent = record name: String; height: Integer; weight: Real; end;function hiroko(name:String; height:Integer; weight:Real):TSt…

構造体と typedef

明解C言語 入門編 > 12. 構造体 > 構造体と typedef Delphi

-> 演算子

明解C言語 入門編 > 12. 構造体 > -> 演算子 Delphi

構造体の受け渡し

明解C言語 入門編 > 12. 構造体 > 構造体の受け渡し Delphi program Project1;{$APPTYPE CONSOLE}uses SysUtils;type TStudent = record name: String; height: Integer; weight: Real; end;procedure hiroko(var std:TStudent); begin std.height := 180; …

構造体のメンバの初期化

明解C言語 入門編 > 12. 構造体 > 構造体のメンバの初期化 Delphi 実行結果 Perl %sanaka = (name => "Sanaka", height => 175, weight => 60.5); printf("氏名:%s\n", $sanaka{"name"}); printf("身長:%d\n", $sanaka{"height"}); printf("体重:%f\n", …