var format1: array[0..49] of wchar;
s: string;
begin
s:=chr(48)+chr(16)+'办公室';
StringToWideChar(s,format1,length(s));
end;
转换后format1结果为(#8,#$10,'办','公','室')
现在我想使format1结果为(#8,#$10,'办','公','室','\0')
尝试着以下操作但结果都不正确
(1)begin
s:=chr(48)+chr(16)+'办公室'+'\0';
StringToWideChar(s,format1,length(s));
end;
format1结果为(#8,#$10,'办','公','室','\','0')
(2)begin
s:=chr(48)+chr(16)+'办公室\0';
StringToWideChar(s,format1,length(s));
end;
format1结果为(#8,#$10,'办','公','室','\')
哪位大侠帮帮忙,解决立即给分.
s: string;
begin
s:=chr(48)+chr(16)+'办公室';
StringToWideChar(s,format1,length(s));
end;
转换后format1结果为(#8,#$10,'办','公','室')
现在我想使format1结果为(#8,#$10,'办','公','室','\0')
尝试着以下操作但结果都不正确
(1)begin
s:=chr(48)+chr(16)+'办公室'+'\0';
StringToWideChar(s,format1,length(s));
end;
format1结果为(#8,#$10,'办','公','室','\','0')
(2)begin
s:=chr(48)+chr(16)+'办公室\0';
StringToWideChar(s,format1,length(s));
end;
format1结果为(#8,#$10,'办','公','室','\')
哪位大侠帮帮忙,解决立即给分.
var format1: array[0..49] of wchar;
s: string;
begin
s:=chr(48)+chr(16)+'办公室' + #0; //这样就可以了
StringToWideChar(s,format1,length(s));
end;
一样
或者
把#0换成#8呀#10呀之类的
你试试吧