×Ö·û´®µÄÁ½ÖÖ²»Í¬·ç¸ñ: C++·ç¸ñºÍC·ç¸ñ
Õâ¸öÌá·¨Óеã¹ÖÒ죬µ«»¹Êdz£³£³öÏÖ:
char *p = "abcd";
ºÍ
string str = "abcdefg";
µÚÒ»¸ö½Ð×öC·ç¸ñµÄ×Ö·û´®£¬ÔÒòÊÇÓÐnull×÷Ϊ½áβ; µÚ¶þ¸öΪC++·ç¸ñµÄ, ²»ÊÇÒÔnull½áβ.
ʵÖÊÉÏ: C·ç¸ñµÄ×Ö·û´®ÊÇ:
char[] pArr = {'a', 'b', 'c', 'd', '\0'};
ÕâÑù¾ö¶¨ÁË´¦Àí·½Ê½µÄ²»Í¬
Ïà¹ØÎĵµ£º
Delphi Óë C/C++ Êý¾ÝÀàÐͶÔÕÕ±í
DelphiÊý¾ÝÀàÐÍC/C++
ShorInt
8λÓзûºÅÕûÊý
char
Byte
8λÎÞ·ûºÅÕûÊý
BYTE,unsigned short
SmallInt
16λÓзûºÅÕûÊý
short
Word
16λÎÞ·ûºÅÕûÊý
unsigned short
Integer,LongInt
32λÓзûºÅÕûÊý
int,long
Cardinal,LongWord/DWORD
32λÎÞ·ûºÅÕûÊý
unsigned long
Int6 ......
¸ñʽ£ºÎļþÖ¸ÕëÃû=fopen(ÎļþÃû£¬Ê¹ÓÃÎļþ·½Ê½)
²ÎÊý£º
ÎļþÃû ÒâÒå
"C:\\TC\\qwe.txt" ÎļþC:\TC\qwe.txt
"qwe.txt" ºÍ³ÌÐòÔÚͬһĿ¼ÏµÄqwe.txt
ÎļþʹÓ÷½Ê½ ¡¡ Òâ Òå
“rt”¡¡¡¡¡¡¡¡¡¡¡¡Ö»¶Á´ò¿ªÒ»¸öÎı¾Îļþ£¬Ö»ÔÊÐí¶ÁÊý¾Ý
“wt”¡¡¡¡¡¡¡¡¡¡¡¡Ö»Ð´´ò¿ª»ò½¨Á¢Ò»¸öÎı¾Îļþ£¬Ö»ÔÊÐíдÊý¾Ý ......
×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½,ÈçºÎѧϰCºÍC++²Å²»Ã£È»,²Å²»ÊÇÂÒѧ¡£ÏëÁËÒ»ÏÂ,ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£
Ò»¼ÒÖ®ÑÔ,»¶ÓÅÄש¹þ¡£
1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC
´ó¶àÊýʱºò,ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ,²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò,¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓ ......
1. ÕÒ´í
#define MAX_SRM 256
DSN get_SRM_no()
{
static int SRM_no;
int I;
for(I=0;I<MAX_SRM;I++,SRM_no++)
{
SRM_no %= MAX_SRM;
......