Learn C memory addresses in 7 minutes 📬

Ғылым және технология

C memory address tutorial example explained
#C #memory #address
int main()
{
// memory = an array of bytes within RAM (street)
// memory block = a single unit (byte) within memory (house), used to hold some value (person)
// memory address = the address of where a memory block is located (house address)
char a;
char b[1];
printf("%d bytes
", sizeof(a));
printf("%d bytes
", sizeof(b));
printf("%p
", &a);
printf("%p
", &b);
return 0;
}

Пікірлер: 37

  • @BroCodez
    @BroCodez2 жыл бұрын

    #include int main() { // memory = an array of bytes within RAM (street) // memory block = a single unit (byte) within memory (house), used to hold some value (person) // memory address = the address of where a memory block is located (house address) char a; char b[1]; printf("%d bytes ", sizeof(a)); printf("%d bytes ", sizeof(b)); printf("%p ", &a); printf("%p ", &b); return 0; }

  • @SNKJay
    @SNKJay2 жыл бұрын

    Thank you! Your channel is one of the reasons I get to keep my job :)

  • @kklol07

    @kklol07

    2 ай бұрын

    how many times do you get into a situation which makes you feel like ok idk shit and i wanna get back to basics

  • @pacocarrion7869
    @pacocarrion78692 жыл бұрын

    Impressive explanation, respect.

  • @jagdishpradhan5580
    @jagdishpradhan5580 Жыл бұрын

    Oh man you've just clear my doubt. Thanks 👍

  • @kasmikregmi330
    @kasmikregmi33011 ай бұрын

    not using short in a long time was totally funny dude, keep it up

  • @guilherme1556
    @guilherme15564 ай бұрын

    Great explanation, so simple to understand a complex topic!

  • @techgirl248
    @techgirl248 Жыл бұрын

    thank you so muchhh wow. i was having trouble understanding this but its so much clearer now!

  • @prumchhangsreng979
    @prumchhangsreng9792 жыл бұрын

    I love the analogy, really help

  • @air901
    @air9016 ай бұрын

    this channel is so underrated honestly

  • @JMBooy
    @JMBooy Жыл бұрын

    Great explanation 👍

  • @gunthersantos
    @gunthersantosАй бұрын

    Gratefull for the rich content.

  • @Atomos_tech
    @Atomos_tech Жыл бұрын

    Awesome bro, Keep it up👍❤

  • @JAyjofirst
    @JAyjofirstАй бұрын

    perfectly explained

  • @whisperscribe
    @whisperscribe Жыл бұрын

    Thanks Bro, you are a Bro.

  • @NNNedlog
    @NNNedlog2 жыл бұрын

    Thanks again bro

  • @Notthetylor
    @Notthetylor Жыл бұрын

    Wow. Wow. Wow. U r my bro!!!!!!

  • @multicitygirl5527
    @multicitygirl55272 жыл бұрын

    thank u sooooo much!!!!!!!

  • @KartikeyTT
    @KartikeyTT4 ай бұрын

    Lovely

  • @helias7460
    @helias7460 Жыл бұрын

    Thanks bro!

  • @subhamdas2491
    @subhamdas2491 Жыл бұрын

    That's too good

  • @dallasvienneau
    @dallasvienneau2 ай бұрын

    Is there underlying(under the hood) code that is executed, that will find a memory address to assign to the variable a of data type char when char a = 'X'; is executed by the complier. Or asked a different way, how does the complier know its been given instructions to find a memory address to store a variable when char a = 'X'; is executed.

  • @proddirtneck

    @proddirtneck

    Ай бұрын

    You need to learn assembly to figure that out

  • @happyjohn1656
    @happyjohn1656 Жыл бұрын

    Why do memory addresses decrease instead of increment? This just the standard implementation?

  • @oussemaelmzergui7055

    @oussemaelmzergui7055

    7 ай бұрын

    i think so

  • @FLMKane
    @FLMKane4 ай бұрын

    What if I told you that you answered all my questions within 30 seconds?

  • @coder4937
    @coder49372 жыл бұрын

    You promised me for face reveal in omegle..... Remember me XD

  • @qmance8062
    @qmance8062 Жыл бұрын

    use a for loop geez :D

  • @quotablecode
    @quotablecode2 ай бұрын

    Why do you pronounce char as char

  • @hodayfa000h

    @hodayfa000h

    Ай бұрын

    Char as char? Or char as char? I like to say char more tbh Saying char is a disease, say it like: char, the best way

  • @PhamTony
    @PhamTony Жыл бұрын

    Hi, Probably a naive question, but when I looked up the address on my linux, I got results such as these: 0x7fff9c1f2c2f 0x7fff9c1f2c2e 0x7fff9c1f2c2d I know they're hex as well, but why do they appear like this? Is that formatting configuration on VSCode or is it that the architecture of memory of Linux and Windows is different?

  • @minecraftsteve2711

    @minecraftsteve2711

    Жыл бұрын

    I think It's because on windows, memory is viewed differently from Linux, not for VSCode

  • @buddy.abc123
    @buddy.abc123 Жыл бұрын

    int a = 'x'; double a = 'x'; ????😅

  • @oussemaelmzergui7055

    @oussemaelmzergui7055

    7 ай бұрын

    in C if you assign a character to a variable which is integer or double, it takes the ASCII code of this character. so basically : a = 120

  • @anassbenomar748
    @anassbenomar748 Жыл бұрын

    php course please 😇😇😇

  • @gunnury7377
    @gunnury7377 Жыл бұрын

  • @adamcylee
    @adamcylee3 күн бұрын

    EXCELLENT!

Келесі