Gary Explains
Gary Explains
  • Видео 621
  • Просмотров 34 294 887
Pointers to Structures in C - 9 Examples to Kickstart Your Journey
The C programming language makes heavy use of pointers. Following on from my videos on "Pointers in C" and "Dynamic Memory Allocation in C - malloc, free, and buffer overflows" here is my tutorial on how to use pointers to structures, along with 9 practical examples.
---
Pointers in C: ruclips.net/video/mw1qsMieK5c/видео.html
Dynamic Memory Allocation in C - malloc, free, and buffer overflows: ruclips.net/video/wadj1UH2gVQ/видео.html
Twitter: garyexplains
Instagram: garyexplains
#garyexplains
Просмотров: 2 377

Видео

How Fast is Microsoft’s New PRISM x86-64 Emulator?
Просмотров 30 тыс.День назад
With the launch of Windows 11 24H2, Microsoft is promising an x86 emulation performance boost due to its new Prism x86/x86-64 emulator. Prism allows Arm-based Windows laptops to run Intel/AMD code, without modification. Windows has been able to do this since Windows 10, however Prism is a revamp that promises parity with Apple's Rosetta emulation. 00:00 Intro 01:19 Why is it necessary? 03:09 Ar...
I Took a 10 Year Old Camera on my First Trip to New York - Does Gear Matter?
Просмотров 3,1 тыс.2 дня назад
I recently had the chance to visit New York, my first time in the Big Apple! I wanted to take some photos to remember the occasion, so I decided to take a 10 year old mirrorless camera. Did I make a mistake? Does gear matter? Let's find out! Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: garyexplains #garyexplains
Copilot+ PCs - Do you need an NPU? Microsoft Says "Yes", I Say "No"
Просмотров 20 тыс.21 день назад
Microsoft's new vision for an AI infused Windows computer is known as Copilot PC and it relies on the PC having a Neural Processing Unit or NPU for short. What is an NPU? Why does a Copilot PC need an NPU? Is it optional? Let's find out. Your GeForce PC can run Copilot Plus features, but here's why it doesn't: www.androidauthority.com/nvidia-copilot-plus-geforce-gpu-3447266/ Twitter: twitter.co...
Play Call of Duty Mobile 72% Faster with Arm Immortalis-G925
Просмотров 7 тыс.21 день назад
Arm has announced a new smartphone GPU that will be used in Android devices coming in 2025. The new GPU, called the Immortalis-G925, offers significant performance gains for complex geometry games like Call of Duty Mobile or Genshin Impact. The GPU is expected to be used by chipmakers like MediaTek and ship in 2025's flagship devices. Twitter: garyexplains Instagram: g...
New Arm CPU Designs - Cortex-X925 and Cortex-A725
Просмотров 29 тыс.21 день назад
Arm has announced two new CPU designs for smartphones that will hit the shelves during 2025. Following its normal cadence it has announced the new designs now and it is expected that chipmakers like MediaTek will announce SoCs using these designs later this year. The Cortex-X925 is the new name for what we expected to be the Cortex-X5 "Blackhawk" CPU. Twitter: garyexplains Instagram...
M4 Deep Dive - Apple's First Armv9 Processor
Просмотров 117 тыс.Месяц назад
Here is my look at the new Apple M4 processor. Apple's next gen chip has been redesigned to utilize Armv9 and extensions like Scalable Matrix Extension 2 (SME2). This will be the foundation for the next several years of processors from Cupertino. Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: garyexplains #garyexp...
Unity Game Development on Arm - Why it is Important
Просмотров 4,5 тыс.Месяц назад
The global gaming market is estimated to rake in over $184 billion, and it continues to grow daily. Mobile gaming is characterized by core technologies, including smartphone operating systems, game engines, and hardware. Arm’s CPU and GPU architectures are fundamental in the mobile gaming landscape, as is Unity. 70% of the top 1,000 mobile games are made with Unity. As the mobile gaming market ...
Connect to Your Raspberry Pi From Anywhere in the World Using Raspberry Pi Connect
Просмотров 7 тыс.Месяц назад
The Raspberry Pi team has released a new service that allows you to connect to your Raspberry Pi from anywhere on the Internet. The new Raspberry Pi Connect service is a secure and easy-to-use way to access your Raspberry Pi remotely, from anywhere on the planet, using just a web browser. Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Inst...
TerraMaster D8 Hybrid - 8-Bay Direct Attached Storage (DAS) with RAID
Просмотров 6 тыс.Месяц назад
The TerraMaster D8 Hybrid is an 8-Bay Direct Attached Storage (DAS) unit with RAID features. It supports up to 4 x 24TB SATA HDDs and 4 x 8TB high-speed M.2 NVMe SSDs, for a capacity of up to 1​28TB! The first two SATA drives can be configure using RAID including RAID 0 and RAID 1. The D8 Hybrid supports USB 3.2 Gen 2 which means you can transfer files up to 900MB/s. D8 Hybrid on Kickstarter: k...
Ubuntu 24.04 on the Raspberry Pi - How to, Setup, and Demo
Просмотров 11 тыс.Месяц назад
In this video I show you how to install Ubuntu 24.04 Desktop on a Raspberry Pi 5 with an NVME drive. But I also show you how to install Ubuntu 24.04 Server on a much more modest Raspberry Pi Zero 2 W. Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: garyexplains #garyexplains
Ubuntu 24.04 LTS Review - Noble Numbat Overview
Просмотров 18 тыс.Месяц назад
Ubuntu 24.04 is a Long Term Support release of the popular Linux distro. It offers five years of support out-of-the-box, with the option to extend it to 10 years via Ubuntu Pro. Codenamed Noble Numbat, this release includes Linux 6.8, GNOME 46, plus a re-written App Center. Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: instagra...
New Arm-based Laptop Processor from Qualcomm - The Snapdragon X Plus - Faster than the Apple M3!
Просмотров 24 тыс.2 месяца назад
Qualcomm has announced a new member of its Snapdragon X series of laptop processors. The Snapdragon X Plus is a 10-core processor using Qualcomm's custom Arm-based Oryon CPU core design. According to Qualcomm it has a higher multi-core Geekbench 6 score than the Apple M3. Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: instagram....
How to Run LLAMA 3 on your PC or Raspberry Pi 5
Просмотров 11 тыс.2 месяца назад
Meta (i.e. Facebook) has released Llama 3, its latest Large Language Model. It comes in two sizes, an 8 billion parameter model and a 70 billion parameter model. In this video I look at how you can run the 8 billion parameter model on your PC or even on a Raspberry Pi 5. Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: instagram.c...
Floating Point Numbers - This is Where Things Get Weird!
Просмотров 5 тыс.2 месяца назад
Following on from my video about Fixed Point Numbers, now it is time to look at Floating Point Numbers. On the way we will look at binary fractions and why in C you can't increment a float above 16777216! Strap in, things are about to get weird! Let Me Explain T-shirt: teespring.com/gary-explains-let-me-explain-2 Twitter: garyexplains Instagram: garyexplains #garyexpl...
Fixed Point Decimal Numbers - Including Fixed Point Arithmetic
Просмотров 3,9 тыс.2 месяца назад
Fixed Point Decimal Numbers - Including Fixed Point Arithmetic
Udio: The Insanely Good FREE AI Music Maker!
Просмотров 8 тыс.2 месяца назад
Udio: The Insanely Good FREE AI Music Maker!
What is the Google Axion Processor? Google's new Arm-based Processor!
Просмотров 10 тыс.2 месяца назад
What is the Google Axion Processor? Google's new Arm-based Processor!
How do QR Codes Work? Features, Format, Error Correction, and More!
Просмотров 28 тыс.2 месяца назад
How do QR Codes Work? Features, Format, Error Correction, and More!
OpenDevin, an autonomous AI software engineer - Is Skynet coming?
Просмотров 6 тыс.2 месяца назад
OpenDevin, an autonomous AI software engineer - Is Skynet coming?
Snapdragon 8s Gen 3 vs Snapdragon 8 Gen 3
Просмотров 20 тыс.2 месяца назад
Snapdragon 8s Gen 3 vs Snapdragon 8 Gen 3
Google Tensor G3 Performance per Watt
Просмотров 6 тыс.3 месяца назад
Google Tensor G3 Performance per Watt
Calculate Pi on a Raspberry Pi Using the Leibniz Formula for π - Pi Day 2024
Просмотров 3,4 тыс.3 месяца назад
Calculate Pi on a Raspberry Pi Using the Leibniz Formula for π - Pi Day 2024
Budget-Friendly AI APIs - A Must-Watch Guide!
Просмотров 3,1 тыс.3 месяца назад
Budget-Friendly AI APIs - A Must-Watch Guide!
Benchmarks Say Claude 3 is Better than GPT-4, But is It?
Просмотров 6 тыс.3 месяца назад
Benchmarks Say Claude 3 is Better than GPT-4, But is It?
The Shunting Yard Algorithm Demystified: Transform Expressions Like a Pro!
Просмотров 5 тыс.3 месяца назад
The Shunting Yard Algorithm Demystified: Transform Expressions Like a Pro!
What is Reverse Polish Notation (AKA Postfix Notation)? Why is it Important?
Просмотров 4,3 тыс.3 месяца назад
What is Reverse Polish Notation (AKA Postfix Notation)? Why is it Important?
Mistral AI: The Multilingual GPT From Europe - Is it Any Good?
Просмотров 7 тыс.3 месяца назад
Mistral AI: The Multilingual GPT From Europe - Is it Any Good?
How to Run Google's New FREE AI Model on Your PC - But is it Any Good?
Просмотров 4,6 тыс.4 месяца назад
How to Run Google's New FREE AI Model on Your PC - But is it Any Good?
Machine Learning vs AI vs Deep Learning - The Differences Explained
Просмотров 6 тыс.4 месяца назад
Machine Learning vs AI vs Deep Learning - The Differences Explained

Комментарии

  • @QuinnCheryl
    @QuinnCheryl 23 часа назад

    It's sad you have an Apple Playlist but not Android .

  • @Ricky-vd4oq
    @Ricky-vd4oq День назад

    Good job Gary, fuck cant believe this sort of shit really happens. So grateful i live a quiet life in my comfy little home.😊

  • @Chalisque
    @Chalisque День назад

    I also imagine 128bit arithmetic would necessitate very long pipelines, or at least a significant latency compared to 64bit arithmetic.

  • @ruudbijvank693
    @ruudbijvank693 День назад

    Just moved to the new copilot plus and I love it. Performance is top notch, so is battery live. Truth is, I spend most of my time in office and Teams which run flawlessly. The old x86 Kindle app runs fine, but to be honest, it does not need performance. What is someless suboptimal are Windows drivers that use the emulation. I'm using a Dragonfly cobalt USB DAC paired with Headphones. This one does not have a ARM driver and runs on the emulated windows driver. It generally works, but since a DAC is really time critical it comes with a lot of hisses and artifacts in sound. So that needs a bluetooth headphones. But generally speaking - Performance is excellent.

  • @morecarstuff
    @morecarstuff День назад

    I absolutely DON'T want any copilot. i didnt even want cortana BS.

  • @timothyvaher2421
    @timothyvaher2421 День назад

    You got it spot on! It's modeled on past data. It's evolved to conversational specific returns: "Chats" We built it, We paid for it. It's "They're" illusion "they" own it. It's a scraped natural resource We own. A "government" data base.

  • @qwe14205
    @qwe14205 День назад

    Hi Gary, nested virtualization will be available on a macOS Sequoia, but only for M3 series chips and higher, even though M2 series chips already had a hardware support for it. Please test both cases when OS update drops, it would be a great info for devs. Thanks and good luck with the channel.

    • @GaryExplains
      @GaryExplains День назад

      That sounds cool. Unfortunately I only have an M1 based MacBook, not an M3 or M4.

  • @user-um9sl1kj6u
    @user-um9sl1kj6u День назад

    I was thinking in terms of an integrated AI- one with computer vision at 60 frames per second, and say a paired down specialty version of chat gpt (to help interact with people, along with canned prompts) I wonder how much computing power you need in order for system to keep track of chemicals, pipes, and help people in a given area. - think of what Amazon does in their stores when they had people just pick stuff up and go, versus say a chemical plant and just keeping everything safe- with a more refined version of ChatGPT to inform everyone in an area of an issue, or to be able to intelligently answer questions, even with a manager in an area. The biggest issue in any place is even when you have highly skilled and educated people, people get tired and mistakes can happen. - AI can help make chemical factories Safer, Nicer, and near accident proof, but you need a system that isolates all of their electrical components and any heat they might generate (say a rubber cap near a wireless induction coil) Do you think 1 or 2 Orin modules would be enough to make an area in a factory safer?

  • @Dan-vi5jp
    @Dan-vi5jp День назад

    Ya people on Windows ARM do spend 90% of their time on native ARM apps because the emulator is terrible, especially with older software. I am on second Windows ARM computer and I am going to be switching back to AMD for my next purchase.

  • @PragmaticTornado
    @PragmaticTornado День назад

    It's funny that my desktop with an RTX 4090, would absolutely smoke all of these bespoke NPU's. But because of greed and marketing reasons, that probably won't happen. Though I'm the kind of guy who uses GPedit / RegEdit to disable as much telemetry as possible, so a feature that takes regular snapshots of your actual screen - probably isn't for me. It's a new AI-powered world, of telemetry and privacy concerns.

  • @careypridgeon
    @careypridgeon День назад

    the fact that ten years is considered old for digital/mirrorless is a HUGE part of why I'll never touch them. Apart from my coach built large format ones the youngest film camera I own is 42 years old, and they all work perfectly. The oldest is 60 years old and aside from a service to check everything there haven't been problems with that one either.

  • @KevinInPhoenix
    @KevinInPhoenix День назад

    For laptop use the ARM processors are attractive because of their lower power demands. On desktops and servers there is no compelling case for ARM processors. There are no ARM only Windows applications so x86-64 will continue to be the architecture of choice. If ARM processors offered competitive performance to x86-64 at a lower price then there might be a reason for them outside of the laptop space.

    • @GaryExplains
      @GaryExplains День назад

      For servers there is no compelling case? Really? 🤔 You had better tell Amazon, Microsoft, Google and Oracle quickly! Amazon is on its 4th generation of Arm server chip already and they haven't yet noticed that there is no compelling reason... Oops.

  • @scarlettuwu9582
    @scarlettuwu9582 День назад

    So these Matrix extensions are an architecture within the CPU that allows for and enhances running artificial intelligence programs? So usage case scenario if I’m using AI programs to create artwork or animation, these matrix extensions would increase the capability of the AI results in a quality sense? Am I understanding this correctly?

    • @GaryExplains
      @GaryExplains День назад

      No, it is never about quality, but about speed and efficiency. You might like my video on Microsoft mandating the need of an NPU in Copilot+ PCs.

  • @user-fq3pz4io2y
    @user-fq3pz4io2y 2 дня назад

    Your code works great, I was also pleased that the clock continues to keep time on its own after losing the network connection. Thank you!

  • @johncage5368
    @johncage5368 2 дня назад

    7:10 ... and there it failed 😂

  • @DarrylDeAbreu
    @DarrylDeAbreu 2 дня назад

    How can I install a x64 program on my Snapdragon processor? I am trying to install Insta360 studio but it doesn't let it and says it can only be installed on systems with x64 architecture

  • @johnhunt1725
    @johnhunt1725 3 дня назад

    15 years ago, a similarly spec'd desktop PC would cost you over 2 grand.

  • @achillesmichael5705
    @achillesmichael5705 3 дня назад

    Finally someone who knows his stuff

  • @ryanvangeems7127
    @ryanvangeems7127 3 дня назад

    You're a champ for answering at the start! Watching all of it just because you're a legend 🎉

  • @xtrmsnpr
    @xtrmsnpr 3 дня назад

    Installed on my pi 8gb using an kingston canvas SD, but it's laggy a bit. Especially on 1080p yt vids. Now i'm waiting for an nvme to arrive and start using the OS in there and see how it goes. It seems ubuntu needs tons of optimization still, for pi5!

  • @neilmontgomery3470
    @neilmontgomery3470 3 дня назад

    It does seem to me that reviews were much easier on M1 when it launched without native apps. Also Rosetta was almost presented as a zero penalty way of running x86 apps which was not really the case. I suspect a lot of the reviewers personally used Macs so were swayed by the new technology.

  • @danniejaysarmiento2792
    @danniejaysarmiento2792 4 дня назад

    Looks like 7+ gen 1 overclock for me. I go for sd 8 gen 2

  • @garyljackson
    @garyljackson 4 дня назад

    I see you have SQL server is listed in the native applications section in the developer tools box. I'm not able to find an ARM supported version of Microsoft SQL - even the Azure SQL edge version has dropped ARM support - where did you get that information?

  • @JohnJohn-dc7id
    @JohnJohn-dc7id 4 дня назад

    Well done video. Nicely explained

  • @PaulFurber
    @PaulFurber 4 дня назад

    zig is getting to be very impressive technology indeed. If I understand the docs correctly you can create a library using zig with a C ABI so that C can call into Zig code and all of its nice advanced data structures transparently.

  • @popcornguy96
    @popcornguy96 4 дня назад

    Emulation is just the first step of migration, once user base is so high then developers will develop native arm programs

  • @Winchuff
    @Winchuff 4 дня назад

    Torvaulds invented the Linux KERNEL, not an O/S. The O/S to which you refer, is the GNU OS, of which Richard Stallman is the founder.

    • @GaryExplains
      @GaryExplains 4 дня назад

      😂 no. In fact I have a whole video about why you are wrong.

  • @jeremy7433
    @jeremy7433 4 дня назад

    So what happens if you hook it up to a non-POE device will it Cause damage

  • @bm1066
    @bm1066 4 дня назад

    Fedora users are encouraged to use DNF now, not RPM from what I understand.

  • @fbifido2
    @fbifido2 4 дня назад

    @6:14 - they said 2x faster than "Windows 11 22H2" so, what was or is the score on "Windows 11 22H2" vs "Windows 11 24H2"????

  • @fbifido2
    @fbifido2 4 дня назад

    @4:26 - i don't see word on the list, i see that they will port over OneDrive, Excel, Teams, PowerPoint, Outlook and OneNote. you think they should have had these from a long time ago. Gary, I hope you can test to see which of the office apps will use native arm or emulated x86.

  • @LA-MJ
    @LA-MJ 4 дня назад

    The range on chrysler building sucks. That's why you would want a bigger/better sensor and a lighter lense

    • @GaryExplains
      @GaryExplains 4 дня назад

      What has range got to do with sensor size?

  • @autarchprinceps
    @autarchprinceps 4 дня назад

    I'd love to see a Linux on Snapdragon X Elite test. Supposedly they promised support is there with recent enough kernels, and assuming the sometimes less well supported bluetooth, wifi, sound & GPU and video encoding acceleration weren't scimped out on, the actual ARM CPU part should be great under Linux. SBCs and ARM servers have made more than enough distros have full ARM package support, heck even most proprietary tools have been ported. The only thing missing natively is likely Steam for Linux, which I don't care that much on an ultralight laptop, especially one maybe provided from work, and I have fundamentally seen someone emulate, even if that typically for Linux may be a little more complicated than Rosetta or even Microsoft's solutions.

  • @lucasbrown7338
    @lucasbrown7338 4 дня назад

    Hearing about the Dimensity 8250 ! Super curious to see phones with 320MP cameras! Imagine the crazy zoom capabilities!

  • @z352kdaf8324
    @z352kdaf8324 5 дней назад

    x128 here I come!!!

  • @TMNIARB3A
    @TMNIARB3A 5 дней назад

    great explanation sir... thank you sm!

  • @hilmyakatsuki1665
    @hilmyakatsuki1665 5 дней назад

    Waiting for AMD to come up with ARM by 2026 according to their roadmap

  • @hilmyakatsuki1665
    @hilmyakatsuki1665 5 дней назад

    liked that you used a normal slide template from google slide and used it rather than using fancy AI generated background and slides that looks shit

  • @AndreiMorar
    @AndreiMorar 5 дней назад

    I want a gaming/productivity laptop with an Nvidia/AMD high end GPU and an ARM cpu. I also want to have upgradeable RAM, SSD, Wifi and battery, just as I do on my current Legion laptop. Hope this will be available in 2 years.

  • @jamieknight326
    @jamieknight326 5 дней назад

    Is it too early to hope there’s a RISC-V version of Windows in a lab somewhere… perhaps reusing the same underlying approach as PRISM for mainstream adoption…. A boy can dream right… a boy can dream 💤

    • @GaryExplains
      @GaryExplains 5 дней назад

      Why would you want a RISC-V version? What advantage is there to a RISC-V version?

    • @jamieknight326
      @jamieknight326 5 дней назад

      @@GaryExplains there’s a few reasons. The main three are flexibility, vectorisation scale and the allure of open systems. On the flexibility side it’s easier to use RISC-V cores within small volume (5-10k) fab runs, I’m curious what OEMs would end up using it for if they could build out custom hardware with the exact accelerators required for the use case. Especially in things like the broadcast chain where a handful of very specific boxes do a lot of legwork to mux and encode signals. Many of them (amazingly!) run Windows. In my own work around fintech a windows based high thread count box would be handy for running some of our absurdly parallel test suites which can’t be GPU accelerated. The second appeal is vectorisation. The vectorisation 1.0 spec in RISC-V is much more flexible than things like AVX512 and CUDA. A high core count vector optimised RISC-V workstation could be a perfect fit for a lot of situations where a GPU isn’t the right solution but there’s ample non scalar performance opportunities. Doing this without need to rack up a server or pay AMD Epic / Xeon money would be appealing (if it ever happened!) The ‘open’ part is more philosophical than practical. Being able to prove via open techniques the trust chain within a system is pretty neat. There’s also the positive business pressure of open alternatives to currently locked down proprietary systems. Especially when it comes to hardware reuse and recycling. I find an open hardware platform with a Windows on top is a surprisingly appealing concept. Hope that makes sense, shout if ya fancy a chat sometimes and I’d be happy to share more about the use cases we’d have.

    • @GaryExplains
      @GaryExplains 5 дней назад

      Hmmm.... Those are all very specific niche reasons. The cost of making small fab runs is irrelevant to 99.9% of people and certainly irrelevant to Windows on RISC-V. It is also irrelevant when it comes to high performance SoCs or CPUs with billions of transistors (like the current processors from Intel, AMD, Apple, or Qualcomm). I can't comment on the vectorization, I am not an expert on that. However there is vectorization in Arm and x86 (as you mention) and even if vectorization in RISC-V is somehow magical, that isn't enough to warrant the investment in RISC-V or for Microsoft to make a version of Windows on RISC-V. RISC-V isn't open in the way you describe. Most RISC-V implementations are proprietary and many have proprietary extensions. The notion of "open hardware platform" doesn't exist. In the end you buy a processor from a company, then you need a motherboard to work with that processor, and so on. You need to invest in that proprietary system. There isn't a RISC-V socket definition. Or a RISC-V motherboard specification. Or a RISC-V PC standard. It is all proprietary. The idea that you can have an open system and then pick and chose which CPU you want and if a CPU vendor goes bankrupt then you just drop in a replacement doesn't exist. Even AMD and Intel, which use the same ISA aren't drop in replacements for each other. In a commercial world where each vendors need to bring value and have a unique value proposition there will never be complete open compatibility, that is a death knell in a commercial sense.

    • @jamieknight326
      @jamieknight326 5 дней назад

      @@GaryExplains thanks for sharing your perspective. It’s always interesting to hear the thoughts behind your opinions etc. Hope you have a cracking day.

  • @primoroy
    @primoroy 5 дней назад

    With cpus, gpus, mpus, etc, why not x86 specific cores instead of emulators? The would sit idle on low power most of the time!

    • @GaryExplains
      @GaryExplains 5 дней назад

      I don't understand. Are you saying these Arm based chips should also contain x86 cores?

  • @zrodger2296
    @zrodger2296 6 дней назад

    In the Linux kernel, as far as i know, they always use the 'struct' keyword, instead of defining their own type. I always wondered why that was. Thanks for the video!

    • @GaryExplains
      @GaryExplains 5 дней назад

      Yes, the Linux kernel coding standard forbids typedefs for structs as it says the typedef adds a layer of obscurity.

  • @jecelassumpcaojr890
    @jecelassumpcaojr890 6 дней назад

    I was a little surprised that you can assign structs in C. Checking the original K&R it said that wasn't allowed but it might change in the future, which it obviously has. An early paper on C (before K&R even) bragged about how in C you could always count on "q = p" taking a tiny amount of time unlike other languages that might hide some arbitrary complexity when compiling such an innocent expression. I guess priorities change.

    • @zrodger2296
      @zrodger2296 6 дней назад

      I still prefer a memcpy(), but I'm old fashioned! 😊

    • @GaryExplains
      @GaryExplains 5 дней назад

      From the 2nd edition of the C programming language: "The main change made by the ANSI standard is to define structure assignment - structures may be copied and assigned to, passed to functions, and returned by functions. This has been supported by most compilers for many years, but the properties are now precisely defined. Automatic structures and arrays may now also be initialized. "

  • @4115steve
    @4115steve 6 дней назад

    something that is really confusing is when you used "a" twice in the function deceleration of the last example, a=a+b had me confused because why would a involve itself if it is the answer. I had to pause the video so I could place things in my mind where they needed to be inside of the void point add deceleration. it wasnt clear what void point add was returning. I suppose its returning another struct x and y. it was a great video and very informative, something that might add to another video like this is literally drawing out how things from int main move around into the function declaration at the top

    • @GaryExplains
      @GaryExplains 5 дней назад

      Your questions are good and that is the reason I included that last example. The function doesn't return anything. The key is that the pointer 'a' points to the block of memory where the first struct is stored. The data in the struct pointed to by 'b' is added directly to the data pointed to by 'a', hence a->x=a->x+b->x. When the function returns the memory at 'a' has been modified directly. 'b' remains unchanged. No need for a return of any kind.

  • @DavidAlsh
    @DavidAlsh 6 дней назад

    Hey Garry. great video! If I could make a request; a video series I'd love is one on Rust <-> C/C++ FFI integration for developers who are familiar with Rust but not C. Use cases are things like writing bindings for C/C++ libraries, contributing to Linux (I guess?) and writing dynamic Rust libraries with a stable ABI I'm finding myself learning C just so I can understand the FFI types 😂

  • @George-W-Jenson
    @George-W-Jenson 6 дней назад

    yup, thats a killer feature

  • @Psychlist1972
    @Psychlist1972 6 дней назад

    Nice intro video, Gary. C/C++ isn't taught much in school these days, at least not in intro courses like it used to be. Most start with Java. For folks following along: Keep in mind that adding up the sizeof elements *inside* the struct does not necessarily equal the total size of the struct. I know Gary chose values carefully here so what he walked through was valid for the sizes shown, not necessarily for others. sizeof(point_t) may be larger depending upon alignment. So if you change the string to be 61 characters, depending upon the compiler's default alignment settings, you'll still see sizeof is 72. If you change to be 69 characters, you end up with sizeof being 80 (on x64 Windows visual C++ with default alignment and no packing directives). The takeaway is to always use sizeof on the type you're working with, as shown in the video. Don't make assumptions from adding up sizes of fields in the struct.

  • @nomadic_shadow
    @nomadic_shadow 6 дней назад

    Thanks, Gary. I'm working on my C chops so this is a greatly timed video for me.

  • @Jabid21
    @Jabid21 6 дней назад

    Intel does crazy things when they are desperate. They almost went fabless. What’s the likelihood Intel and AMD will start licensing out their x86 and x64 patents? On second thought it’s gonna be useless when ARM native apps take over.

  • @superangrybrit
    @superangrybrit 6 дней назад

    Very good video! 🙂