Похожие чаты

Here, at same address two different datatypes are stored .

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

11 ответов

11 просмотров

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-> 🙂 ?

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

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

Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
Добрый день, подскажите, пожалуйста, по проблеме. Сегодня на работе утром обнаружилось что по рдп подключиться не получается к серверу 2022. В серверную зашел - на системно...
srv
19
Чтобы перехватить все нажимания буков на форме, надо хук ставить? Пробовал на форме ОнКейДаун, оно ловит клаву если фокус не на компоненте с вводом текста
Serjone
15
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
лучше скажите, причём тут паскаль?
Alexey Kulakov
36
Hey Why do I need headers files in c++ code when creating non library program? does it possible to import namespace without headers?
Jacob
12
Всем привет! вывожу на общей стр дочерние ресурсыв каждом ресурсе галерея, и первая фотка должна выводиться на общей [!DocLister? &prepare=photo !]
Alekso
12
Карта сайта