Enviado em 23/04/2019 - 05:05h
Olá pessoal !!!
//-------------------------------------------------------------------
//
// Saida Windows 64 bits:
// ------------------------------------------------------------------
//
// 0: 0x0, 1: 0xe1, 2: 0xf5, 3: 0x5, 4: 0x64, 5: 0x64, 6: 0x64, 7: 0x64, 8: 0x64, 9: 0x64, 10: 0x64,
// sizeof(int): 4, sizeof(long): 4
//
//-------------------------------------------------------------------
//
// Saida Linux 64 bits:
// ------------------------------------------------------------------
//
// 0: 0x0, 1: 0xe1, 2: 0xf5, 3: 0x5, 4: 0x64, 5: 0x64, 6: 0x64, 7: 0x64, 8: 0x64, 9: 0x64, 10: 0x64,
// sizeof(int): 4, sizeof(long): 8
//
//-------------------------------------------------------------------
//
#include <stdio.h>
#define UC unsigned char
unsigned char buf[100] = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 };
long l = 100000000;
void funcao() {
*(int*)buf = l;
printf("0: 0x%x, 1: 0x%x, 2: 0x%x, 3: 0x%x, 4: 0x%x, 5: 0x%x, 6: 0x%x, 7: 0x%x, 8: 0x%x, 9: 0x%x, 10: 0x%x,\n", (UC)buf[0], (UC)buf[1], (UC)buf[2], (UC)buf[3], (UC)buf[4], (UC)buf[5], (UC)buf[6], (UC)buf[7], (UC)buf[8], (UC)buf[9], (UC)buf[10] );
}
int main (void) {
funcao();
printf ("sizeof(int): %d, sizeof(long): %d\n", (int)sizeof(int), (int)sizeof(long));
return 0;
}
Saida Windows 64 bits:
------------------------------------------------------------------
0: 0x0, 1: 0xe1, 2: 0xf5, 3: 0x5, 4: 0x64, 5: 0x64, 6: 0x64, 7: 0x64, 8: 0x64, 9: 0x64, 10: 0x64,
sizeof(int): 4, sizeof(long): 4
-------------------------------------------------------------------
Saida Linux 64 bits:
------------------------------------------------------------------
0: 0x0, 1: 0xe1, 2: 0xf5, 3: 0x5, 4: 0x64, 5: 0x64, 6: 0x64, 7: 0x64, 8: 0x64, 9: 0x64, 10: 0x64,
sizeof(int): 4, sizeof(long): 8
-------------------------------------------------------------------
Passkeys: A Evolução da Autenticação Digital
Instalação de distro Linux em computadores, netbooks, etc, em rede com o Clonezilla
Título: Descobrindo o IP externo da VPN no Linux
Armazenando a senha de sua carteira Bitcoin de forma segura no Linux
Enviar mensagem ao usuário trabalhando com as opções do php.ini
Como configurar posicionamento e movimento de janelas no Lubuntu (Openbox) com atalhos de teclado
Máquinas Virtuais com IP estático acessando Internet no Virtualbox
Instalar o Microsoft Edge no Slackware 15
Instalando Brave Browser no Linux Mint 22
vídeo pra quem quer saber como funciona Proteção de Memória:
warsaw parou de funcionar após atualização do sistema (solução) (0)
Formatando cartão de memoria que nao formata[AJUDA] (13)
Desde que seja DDR3, posso colocar qualquer memória? [RESOLVIDO] (6)
crontab executar em tempos (1)
Programa duplicado no "Abrir com" e na barra de pesquisa do ... (3)