现在的位置: 首页 > 综合 > 正文

HLA判断字符串是否相等

2013年09月16日 ⁄ 综合 ⁄ 共 496字 ⁄ 字号 评论关闭
program strDemo;

#include ("stdlib.hhf");

static
    string1:    string;
    string2:    string;

begin strDemo;

    str.alloc( @size(char) * 16 );
    mov(eax, string1);
    stdout.put("Enter String1:  ");
    stdin.readLn();
    stdin.gets( string1 );
    stdin.flushInput();
    
    str.alloc( @size(char) * 16 );
    mov(eax, string2);
    stdout.put("Enter string2:  ");
    stdin.readLn();
    stdin.gets( string2 );
   
    clc();
    str.eq(string1, string2);

    if ( @c ) then
        stdout.put(string1, " equal ", string2, nl);
    else
        stdout.put(string1, " not equal ", string2, nl);
    endif;

    str.free(string1);
    str.free(string2);

end strDemo;

抱歉!评论已关闭.