strcmp関数の呼び出しで0を返したいのですが、これはつまり
int strncmp(const char *s1, const char *s2, size_t n);
const char *s1
const char *s2
同じ文字列が含まれている必要があります。s2
文字列「hello」を指し、 4の場合、に対応する10進値n
に渡すにはどうすればよいですか。s1
hello
8049e87: c7 44 24 08 04 00 00 movl $0x4,0x8(%esp) // 4
8049e8e: 00
8049e8f: c7 44 24 04 80 bd 04 movl $0x804bd80,0x4(%esp) // the constant is "hello"
8049e96: 08
8049e97: 89 04 24 mov %eax,(%esp) // The contents of %eax are a decimal (%d)
8049e9a: e8 61 ec ff ff call 8048b00 <strncmp@plt>
8049e9f: 85 c0 test %eax,%eax // I want this to be 0!
ASCIIで「h」の10進値を渡してみましたが、正しい方向に見えましたが、完全ではありませんでした。