数字1101004800与数字20如何对应? [英] How do the digits 1101004800 correspond with the number 20?

查看:166
本文介绍了数字1101004800与数字20如何对应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习如何使用C ++修改内存位置,并且在与MineSweeper混淆时,我注意到当内存中的时钟值为1101004800时,距游戏时间为20秒.数字1101529088与游戏进入21秒相对应.有人可以向我解释一下如何在这10位长数字之间转换为以10为底的数字吗?

I'm trying to learn how to modify memory locations using C++ and when messing with MineSweeper, I noticed that when the clock's value in memory was 1101004800, it was 20 seconds into the game. The digits 1101529088 correspond with 21 seconds into the game. Can someone please explain to me how to convert between those 10-digit long numbers to base-10?

推荐答案

它们使用浮点数表示计时器.这是一个将您的整数转换为浮点数的程序:

They are using floats to represent the timer. Here is a program that converts your integers to floats:

#include <stdio.h>

int main() {
  int n = 1101004800;
  int n2 = 1101529088;

  printf("%f\n", *((float*)&n));
  printf("%f\n", *((float*)&n2));

  return 0;
}

输出:

20.000000
21.000000

这篇关于数字1101004800与数字20如何对应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆