HLA判斷字符串是否相等

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;

發佈了212 篇原創文章 · 獲贊 71 · 訪問量 22萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章