Похожие чаты

Here, at same address two different datatypes are stored .

how is it possible to store two things at same place in memory ?

11 ответов

5 просмотров

C doesnt keep track of data types in memory you used the dirty trick of casting the pointer so it just remains as 0x401 in memory where the extra bits gets removed when you de ref. the new char ptr

Peace- Автор вопроса
Nader Jafari
C doesnt keep track of data types in memory you us...

Means it overwrites the value in memory when char ptr is assigned the address of int ptr ?

Peace
Means it overwrites the value in memory when char ...

The opposite. It doesnt touch the value in memory

1. don't obscure your code. 2. Use a pasting website to share code. 3. you are doing a narrowing conversion, of course the value printed will be different 0x0401 will be seen as as 0x01 0x00000401 (big endian notation) is what it is stored as in memory. when you take a int pointer, it points to 0x00000401 when you take a char pointer, it points to 0x01, when you do (p0+1) it points to the next byte which is 0x04

Peace- Автор вопроса
Manav | avoid unnecessary messaging me
1. don't obscure your code. 2. Use a pasting websi...

https://pastebin.com/QYeQcjzy compiler is returning smile emoji as output of last two print statements . why ? it is the same code in C++.

Peace- Автор вопроса
Peace
@usernamestring

be patient, there is a reason why i haven't replied to you yet. I need to see the output myself.

Peace
@usernamestring

Lol, what emoji do you see? a smiley face?

Peace- Автор вопроса
Peace
yes.

This-> 😄, or this-> 🙂 ?

Похожие вопросы

Обсуждают сегодня

Ясн. Но я всеравно к кедам отношусь с опасением. Чисто субьективное кедосозерцание. Что касаемо "восторга изяшности кед" так и не вкурил, хотя много слышал, пока не поставил с...
Артем Записной
30
They keep hyping $FUN but where's the progress? 🙄
Noah Noure
23
Btw guys very stupid question but i haven't researchd so js asking you pros . Can ltc be traced too? Literally point to pint to the user? And getting the banks blocked ? Exch...
20
type TObj = object procedure Init; virtual; end; TObj1 = object(TObj) procedure Init; override; end; procedure TObj1.Init; begin inherited; end; procedur...
Alexander 👋
29
Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
48
А чем вам питонисты не угодили?😂
.
79
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
How can a minority hashrate chain defend from a fork-hopping ASIC miner? The problem: 1. A miner comes into your network, and mines at 60-70% hashrate. 2. After some time, th...
Kishniev
13
yeap, thanks guys for response, but I really like to understand does a pool created on curve.fi has the option or api or I can call a function of a smart contract to set excha...
Oleg Karoza
11
Hey people, how do I unstake from the old pool and stake in the new pool??
Dyldo Baggins
24
Карта сайта