C++——delphi
声明变量:
int i--i :integer;
int * a--a: ^integer;
int**a--a:^^integer;
int a[10]-- a: array[0..10] of integer;
string a--a : string\a: string[255];
char* a --a:pchar;
声明函数:
void a(){}————procedure a();begin end;
int a(){}————function a():integer ;begin end;
void *a() ————a :=procedure b();
int *a(int)————a :=function b(c: intger):integer;
运算符
=——:=
==——=
& ——and
|——or
!=——<>
*——@
delphi没有指向符,没有逻辑运算符
delphi没有宏定义;
文件操作:
c++:
打开 Open\fopen\fstream\FIle类:
open:底层函数,打开以文件描述符形式,可直接调用 0,1,2输入,输出,错误;stdin,stdout,stderr; wirte,read,close;
open可打开任意文件,可选择以流或者以文本形式;在dup的时候特别好用;
fopen:返回文件结构体指针,fwrite,fread ,fclose;
fstream以流的形式写入;重载过cout,cin;ostream写入;
{
istream ins;
ins.cin<<"djdjsjdfjsdfhsdfh";
}
file为上层函数类,以Unicode编码;
delphi:
createfile\ textfile类\Tinifile类\....:构造函数;
文件夹操作:
c++ _findfirst\FINDFIRST———__findnext\FINDNEXT;
delphi FindFirst ——FindNext;