Home > Back-end > About PChar and string conversions
About PChar and string conversions
Time:09-27
Met a problem today, please help to look at the problem, Var Url: PChar; Url1: PChar; Qqno: string;
The begin Qqno:='1234'; Url:=pchar (qqno); Url1:=pchar (' 1550983476 ');
If (url1=url) then The begin Showmessage (' as'); End the else The begin Showmessage (' different '); The end;
Results: print out is not the same!!!!! Question: why are string this is not the same as the two transitions will please answer.
CodePudding user response:
PChar is each character points to a null-terminated string to a byte Pointers, (may be regarded as a string), it is windowsI special characters, The String is a character array, end with # 0 characters; It is a Delphi special characters, The structure is different,
Qqno:='1234'; Url:=pchar (qqno); Url1:=pchar (' 1550983476 '); The url value is 1234, url1 value is 1550983476, the two are different,
CodePudding user response:
Site of transcoding suggest using USES the IdURI; .
Respon:=TidURI URLDecode (Http Get (TidURI. URLEncode (URLStr)));