#BB12

  Рет қаралды 7,374

Ralph S Bacon

Ralph S Bacon

Күн бұрын

Пікірлер: 176
@medrolet
@medrolet Жыл бұрын
Welcome back, Ralph. You've been missed.👍
@RalphBacon
@RalphBacon Жыл бұрын
Thank you! And a Merry Xmas to you too! 🎄🎅
@SpinStar1956
@SpinStar1956 11 ай бұрын
Bacon is always missed when not around!!! 🤣😂🤣
@hansdegroot652
@hansdegroot652 8 ай бұрын
Yes but he is missing again for quite some time now
@philipreed2758
@philipreed2758 8 ай бұрын
@@hansdegroot652 i was just thinking the same as you today. i hope all is well. x
@rpr42
@rpr42 7 ай бұрын
Miss him as well. Hope he's doing well.
@hariseldon2577
@hariseldon2577 Жыл бұрын
Was wondering where you where. Nice to have you back again.
@RalphBacon
@RalphBacon Жыл бұрын
Hey, thanks! And a Merry Xmas to you too! 🎄🎅
@borayurt66
@borayurt66 Жыл бұрын
Good to see you again Ralph, it has been some time.
@RalphBacon
@RalphBacon Жыл бұрын
It has been a while! Merry Xmas, Happy Holidays! 🎄❄️☃️
@SpinStar1956
@SpinStar1956 11 ай бұрын
Pointers and References are always a tough subject to explain, and so dependent on using precise language to accurately describe. I think you did a great job of both describing and demonstrating the subject. I have for years used "int &x" but can see that "int& x" is actually much more accurate. And the double use-meaning of * is indeed confusing. Thanks and hope 2024 is a good one for all! 73...
@RalphBacon
@RalphBacon 11 ай бұрын
Glad it was helpful! Ironically, since that video I've had to use pointers because the power that be at Espressif decided their interface to tasks was going to be a pointer. So it's always good to be aware of (as well as beware of) pointers!
@ElieWar
@ElieWar Жыл бұрын
Good to see you back
@RalphBacon
@RalphBacon Жыл бұрын
Merry Xmas, Happy Holidays! 🎄❄️☃️
@gregwmanning
@gregwmanning Жыл бұрын
Merry Christmas Ralph
@RalphBacon
@RalphBacon Жыл бұрын
Merry Xmas, Happy Holidays! 🎄❄️☃️
@willofirony
@willofirony Жыл бұрын
Welcome back and Merry Christmas
@RalphBacon
@RalphBacon Жыл бұрын
Merry Xmas, Happy Holidays! 🎄❄️☃️
@martin87865
@martin87865 Жыл бұрын
Hi Ralph, so glad to see you back. I have really missed you, I have learnt so much from your tutorials over the years. please keep it going.
@RalphBacon
@RalphBacon Жыл бұрын
Noted!
@philipwalker2800
@philipwalker2800 5 ай бұрын
Missing your videos Ralph - Hope all is well.
@RalphBacon
@RalphBacon 3 ай бұрын
All is well but I'm taking a break (as you noticed)!
@darrenchapman7203
@darrenchapman7203 2 ай бұрын
Me too Ralph
@tonybell1597
@tonybell1597 Жыл бұрын
A Christmas Ralph vid… Thankyou.. Have a very Happy Christmas
@RalphBacon
@RalphBacon Жыл бұрын
Nice to see you here again! Merry Xmas, Happy Holidays! 🎄❄️☃️
@PGANESH-i4d
@PGANESH-i4d Жыл бұрын
Good to see you again Ralph
@RalphBacon
@RalphBacon Жыл бұрын
Merry Xmas, Happy Holidays! 🎄❄️☃️
@basiljackson3829
@basiljackson3829 Жыл бұрын
Excellent video. Very useful. The only advantage to pointers is that the caller KNOWS that the function COULD change the value. That prevents a debugging nightmare when the function changes the value of a parameter and the calling routing still relies on the ORIGINAL value.
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
This could be a big problem! but then I'm old and stuck in my ways. Still not a problem if you know what it will do due to being well documented code. Still find for embedded work C works just fine for me. Just had to laugh as i saw "A reference allows you to manipulate an object using a pointer, but without the pointer syntax of referencing and dereferencing" so it's just a pointer with an overcoat on to hide it's internals.🙂
@RalphBacon
@RalphBacon Жыл бұрын
@TheEmbeddedHobbyist Yes, like most syntactic sugar, references are (behind the scenes) pointers but with a friendly face. Then again, all variables are really pointers (if you really want to stretch the analogy). And it cleans up after itself, unlike pointers.
@RalphBacon
@RalphBacon Жыл бұрын
@basicjackson3829 Agreed, in principal; but any function that changes the incoming parameters without good reason is a bad function. It should make a copy of the underlying values and change those, for internal use.
@OsoPolarClone
@OsoPolarClone Жыл бұрын
What an early Christmas Present! Glad to see you back.
@RalphBacon
@RalphBacon Жыл бұрын
And a Merry Xmas to you too! 🎄🎅
@fredflintstone1
@fredflintstone1 Жыл бұрын
Ralph! Glad to see you are well, and I wish you and your family Merry Christmas and a happy New year, and I hope to see more videos from you in the new year 🙂
@RalphBacon
@RalphBacon Жыл бұрын
I hope so too! And a Merry Xmas to you too! 🎄🎅
@DavidUnderhill
@DavidUnderhill Жыл бұрын
Thank you for the infomative video. My old programming lecturer at university spent over 3 hrs explaining pointers usage in C++. At the end of the 2 part tutorial he said any programming assignment submitted that used pointers where referencing could be used instead would lose points. This was 30 years ago, paid off bigtime as most programs where (and still are) easier to debug.
@RalphBacon
@RalphBacon Жыл бұрын
Great to hear! I like that lecturer already.
@Friendroid
@Friendroid Жыл бұрын
merry xmas, ralph, for you and your family! thank you for all your teachings :)
@RalphBacon
@RalphBacon Жыл бұрын
My pleasure! And a Merry Xmas to you too! 🎄🎅
@andreweastland9634
@andreweastland9634 Жыл бұрын
Now I no longer know if a function is going to change my variables. With pointers it is pretty obvious when a function has access to my data. It is not complicated to use pointers. It is only made complicated by people explaining it who don't really understand pointers. What's difficult about address of (&) and contents of (*) operators? That's all it boils down to. Merry Christmas and thanks for another great video.
@RalphBacon
@RalphBacon Жыл бұрын
Well, the fact that you don't think it difficult to understand pointers means you're one of the viewers at whom this video was not aimed! Once you "get it" even the rather tortuous code I wrote the other day is clear: applianceType thisApplianceType = *(applianceType *)parameters; becomes clear. Why such nonsense? Because on an ESP32 Espressif decided that the parameter to a task was a (void) pointer. Crazy. And that's because all Espressif coders write in C not C++ (pretty much).
@JCWren
@JCWren Жыл бұрын
I was fixing to post the same thing. I don't want functions autonomously changing variables, I want to pass a pointer so I explicitly know that I'm passing a variable that's going to be altered. I've been writing code for over 40 years and used or experimented with as many languages, and next to COBOL and Python, C++ is one of the worst. Oh, it has some nice features, but the main problem is the way people unknowingly (or deliberately) obfuscate code or make it insanely difficult to debug because of multiple inheritances and such. Also putting code in header files -- That's a crime against nature in my book. My preferred language of choice is C, followed by Forth and assembly (for just about any processor). BTW, Ralph, you're missing the on your print() in line 16 :)
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
Welcome back Ralph been awhile since the last old grey cell workout.
@RalphBacon
@RalphBacon Жыл бұрын
I'm not sure whether the workout was for me or you, but I hope it clarifies things for Arduites, generally!
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
@@RalphBaconI used to liked doing software / firmware V&V at a medical start-up, checking the code to the standards was always a good grey cell work out. Nowadays getting a nudge to go and look something up gives them a little tweak. 🙂
@MikesAllotment
@MikesAllotment Жыл бұрын
Great to see you back Ralph - we've missed you. Another excellent video - very clearly explained, and I have to admit to being one of those old C programmers who used pointers many years ago long before C++ even existed. Bought back a lot of fond memories. Merry Xmas !
@RalphBacon
@RalphBacon Жыл бұрын
Glad you enjoyed it, although as a seasoned C programmer you have my full permission (like you need it!) to continue using pointers! 😆
@kaoshavoc
@kaoshavoc 5 ай бұрын
I love your vids so much. So educational. So real. Well explained. I just sent my brother your way because he has shown interest in arduino and the like and he loves your content too. You are a massive help and inspiration to me in the world of microcontrollers and coding, and frankly life. Thank you so much :D
@RalphBacon
@RalphBacon 3 ай бұрын
Thank you for your kind words!
@markgreco1962
@markgreco1962 Жыл бұрын
Happy holidays Ralph
@RalphBacon
@RalphBacon Жыл бұрын
And Happy Holidays to you too! 🎄🎅
@henrybecker2842
@henrybecker2842 Жыл бұрын
That was very very helpful. When I programmed using 360 assembly and PL/S pointers were always used. I never understood why they are used in modern languages, except as you mentioned yo minimize the overhead of moving large quantities of characters or numbers. Thank you very much
@RalphBacon
@RalphBacon Жыл бұрын
Glad you found it useful!
@gpTeacher
@gpTeacher Жыл бұрын
Very informative Ralph. Thank you! I was worried! I was ready to send out ASAR to look for you! (Arduino Search and Rescue!). Happy holidays to you and your family 🙂
@RalphBacon
@RalphBacon Жыл бұрын
Thanks Gord, but no AS&R required, I was just held captive in my workshop by "other work"! Merry Xmas and a Happy New Year to you too!
@stevex3976
@stevex3976 Жыл бұрын
Merry Christmas a very Happy New Year! Glad you are back.
@RalphBacon
@RalphBacon Жыл бұрын
Same to you! 🎄🎅
@ianneill9188
@ianneill9188 Жыл бұрын
Thanks Ralph, just what I needed. An earlier video of yours introduced me to references and this one tied up a few loose ends and answered some questions I had!
@RalphBacon
@RalphBacon Жыл бұрын
Glad it helped!
@colepdx187
@colepdx187 Жыл бұрын
Ralph! Good to see you, sir.
@RalphBacon
@RalphBacon Жыл бұрын
You too!
@williammcdonald9086
@williammcdonald9086 Жыл бұрын
Thanks Ralph. I was playing with pointers a while back where my function was simply adding 1 to the passed parameter. Today, thanks to you, I discovered that *x += 1; (works) is not the same as *x++: (does not work). That one kicked my butt for quite a while since x++; and x += 1; normally functions the same.
@RalphBacon
@RalphBacon Жыл бұрын
Ah yes, the shorthand methods are tricky to use with pointers. But good job in figuring it out. 👍
@TBoy58_405
@TBoy58_405 6 ай бұрын
Hope to see you back soon Ralph. I appreciate that you need your life balance, but once you have us hooked, you’re easily missed. Take care. Talk soon 👍🏾🤓
@RalphBacon
@RalphBacon 6 ай бұрын
I hope so too!
@_AmHam_
@_AmHam_ Жыл бұрын
Hi Ralph ! You are missed ! Hope everything is well on your side. Merry Christmas and happy new year 🎉
@RalphBacon
@RalphBacon 11 ай бұрын
Happy new year! Everything fine here, just too much "other work", but I may still be able to make the occasional video.
@grahamwise5719
@grahamwise5719 Жыл бұрын
Good video, pointers are useful when sending bytes over a radio link, and say you have floats to send byte by byte and reassemble at the receiver, but don't make mistakes. take care Graham
@RalphBacon
@RalphBacon Жыл бұрын
Well, maybe, Graham but I don't use radio links like that. I just send out packets of data (perhaps using ESP-NOW) and let the device figure out how to do it! Still gets there! Thanks for your Best Wishes and the same to you 🎄
@CXensation
@CXensation Жыл бұрын
Nice to see you back Ralph. Interesting topic - as always. Have to admit I watched it over again before I finally got it
@RalphBacon
@RalphBacon Жыл бұрын
Good stuff! Yes, it may well take a few watches to get it to click.
@MrJozza65
@MrJozza65 Жыл бұрын
Completely with you on this Ralph; pointers have their uses, but there's so much possibility of inadvertently creating bugs that I have avoided them for years. By reference and by value should be enough for pretty much all tasks, unless you are hitting the hardware and need every clock tick available, but in that case you would probably be programming a PIC in assembler and not an Arduino in C++ 🙂
@RalphBacon
@RalphBacon Жыл бұрын
Agreed. C++ gives us References for a reason: to avoid the "challenges" of using Pointers! We could write a bit of assembler for Arduinos too, but does anyone do that except for some real edge cases?
@danman32
@danman32 11 ай бұрын
Thanks Ralph, this clears up a lot. Will take some time to sink in. It is valuable to me as I have been working on an ambitious project that involves porting over Arduino IDE based code and libraries to Pico SDK code using cmake in VSC. Yes, I know, the SDK/cmake platform is designed for C but it supports CPP just fine. A few of the hiccups I've encountered is converting progmem references which uses pointers (or maybe it has been reference?), the other is passing arrays. Perhaps beyond the scope of this topic, but I had found arrays, or rather large memory locations being passed the start of the memory location, and a variable in the function indexing from the start of the memory location by adding to the pointer value. That "mistake" of printing the value of the pointer rather than the value of what the pointer points to could be a good trick for debugging, or at least exploring.
@RalphBacon
@RalphBacon 11 ай бұрын
Arrays are always passed by reference (never by value) because all you get is the address of the first element of the array. You don't even get the size of the array.😲 Hence the better use of vectors in C++, at least. Good luck with your porting project.
@danman32
@danman32 11 ай бұрын
@@RalphBacon I'm aware that arrays are always passed by reference. But I wanted the function to use the memory area pointed to as it sees fit, but compiler wants to keep the dimensions and data type consistent from original I figured workarounds
@Stuart-AJC
@Stuart-AJC Жыл бұрын
At 25:15 you show the value of the pointers as big hex numbers. But in Arduino pointers are two bytes, so how come the pointer values are so huge? Is it because its running on your 64 bit PC? Welcome back, by the way, and looking forward to more videos in the New Year
@RalphBacon
@RalphBacon Жыл бұрын
Yes, spot on! Because I was running this on a 64-bit PC, the pointers (an integer) were 8-bytes long (64-bits divided by 8-bit bytes = 8 bytes). On a 32-bit (eg ESP32 or older Windows PC) machine each pointer/integer is 4 bytes long, and on the humble 8-bit Arduino they use 2-bytes, 16-bit integers, the compiler being optimised for this - the C language requires all integers to be (at least) 16 bits unless you use a definition such as int8_t which "forces" the compiler to use a single byte.
@Stuart-AJC
@Stuart-AJC Жыл бұрын
@@RalphBacon Thanks. Supplementary question: everywhere it says Arduino pointers are 2 bytes/16 bits, which can address 64K assuming unsigned int. But some devices have much more memory than that, such as the RPi Pico, so when I compile the sketch for it I see: Sketch uses 377156 bytes (18%) of program storage space. Maximum is 2093056 bytes. Do pointer sizes change with the device you define in the IDE?
@qcnck2776
@qcnck2776 11 ай бұрын
@@Stuart-AJC Pointers are very specific to the device, and since they point to a memory address, their size is going to depend on the number of bytes used to fully address the memory space. A good way to know for sure is to use sizeof(ptr) Best not to assume😀
@Stuart-AJC
@Stuart-AJC 11 ай бұрын
Thanks@@qcnck2776 it's something I never thought about until Ralph said they were always 16 bits, which is what the Arduino docs say. But I guess they are referring to the original MCUs with 64KB memory. Now that the Arduino IDE can compile for loads of boards with much more memory they should update the docs.
@RalphBacon
@RalphBacon 11 ай бұрын
What @qcnck2776 says is spot on. The pointer must be able to contain the memory address of the last possible byte of memory. I think Intel 80286 (24-bit) got this wrong and they had to "page" memory (max 16MB) for it all to work with virtual memory (up to 1GB). But in some ways the size of the pointer is irrelevant; what are you doing that you need to know the size of a pointer, rather than "just using it"?
@TradieTrev
@TradieTrev Жыл бұрын
It was brought to my attention from a person I really respect to follow the Barr Groups methods for C, how does their implementation convert to C++ from a newbie prospective?
@RalphBacon
@RalphBacon Жыл бұрын
As many will tell you, C++ is not C. Neither is it just "C with classes". Bjarne Stroustrup found C unnecessarily primitive and prone to error. He wanted a static type safe language along with abstraction (OOP). The rest, as they say, is history. Of course, every C++ compiler will also compile C without issue. In fact, some C functions are now part of the C++ language too so the lines can become blurred and confusing. So many supposed C++ developers still use C-style arrays when they should be using vectors; probably because they have a C background - and it works! I can only assume that there are resources out there showing the true C++ path, or what NOT to do in C++ that you do in C. Using pointers willy-nilly, for example, when references were the C++ replacement. The "best" C++ developers are those who learned C++ without learning C. The "worst" are those that know C well, and then "convert", as you put it, to C++ in a haphazard manner. Buy Bjarne's "C++ Programming Language", 3rd edition (or later if there is one). It's not what I call an easy read, but it is the definitive C++ language reference. But others may serve your purpose better by presenting the material in an easier-to-read manner (including a better font! Doh!) with, dare I say it, simpler, Real Life examples!
@danielcastillo357
@danielcastillo357 9 ай бұрын
Ralph I hope is well in England. Looking forward to your next program/video.
@RalphBacon
@RalphBacon 8 ай бұрын
All is well. Thanks for your concern. 👍 Actually, all is well with ME, but England is currently going to the dogs with high interest rates, junior doctors on strike, train drivers ditto, food price inflation out of control and two of our lovely Royal Family now with the big C diagnoses. Can it get any worse? (Rhetorical, of course it can, but let's hope it doesn't). I blame Covid-19 and Brexit - they have decimated a once proud and prosperous country. 😢
@chriskeeble
@chriskeeble 8 ай бұрын
@@RalphBacon Good to see you're still around - have really enjoyed finding your videos recently as I started out on my own Arduino adventure. Have just been sim racing this evening with a bespoke sim racing button box, using an Arduino Leonardo, a good deal of which I learnt about through your videos. As for Brexit - have a look at Ireland and Scotland just this week - we are better off out of the corrupt EU. And as for COVID - our politicians (along with many others around the world) lied, lied and lied again - all while they lined their own pockets and those of their mates. And as for the Royal Family.... sadly there isn't an honest one among them.
@douglasosborn3378
@douglasosborn3378 10 ай бұрын
Great episode! It took me back to my early programming days. I wasn’t, and still am not as clever as you true professional programmers. I never will be, sadly.
@RalphBacon
@RalphBacon 10 ай бұрын
Glad you enjoyed it! But don't underestimate your skills, Doug.
@douglasosborn3378
@douglasosborn3378 7 ай бұрын
I’m sat here watching you videos on state machines and it hit me, I never thanked you for your kind supportive response to my comment. Thank you
@digihz_data
@digihz_data Жыл бұрын
Happy Christmas Ralph.
@RalphBacon
@RalphBacon Жыл бұрын
Thank you, to you too! 🎄🎅
@keldsor
@keldsor Жыл бұрын
Oh, hi - welcome back ... where have you been for so long ? Can you recommend a project for a HOME BURGLER ALARM with PIRs, maybe cameras, HORNs/Sirenes for making noise with wireless ON/OFF arming ! Maybe even by use of internet/Android phone. I have some wired 12V PIRs /HORNs/Sirenes from an older project already placed 😉
@RalphBacon
@RalphBacon Жыл бұрын
Rather than following someone else's project why not start your own. You have already excluded microcontrollers without Wi-Fi because you want and Internet/Phone interface. The ESP32 is the device of choice right now (if you are not using a Raspberry Pi) with decent processing power, Wi-Fi and lots of memory, especially if you get the 8Mb or even 16Mb versions. You could create something in about 10 minutes as a proof of concept and work up from there. Alternatively look at ESPHome (esphome.io/index.html ) which probably has a project you want just waiting for you!
@keldsor
@keldsor Жыл бұрын
@@RalphBacon THX - I'll look into your proposals and the links 🙂
@clausjrgenahlerhansen1236
@clausjrgenahlerhansen1236 6 ай бұрын
Great channel. I have at question regarding global variables. void loop() { int x=5; x will get reset after every turn, a global will not get reset. How to workaround it?
@RalphBacon
@RalphBacon 6 ай бұрын
Declare the integer as you have done in the loop but with the word 'static' in front of it. This will ensure it is removed (by the compiler) from the actual loop but is accessible to the code in there. A sort of pseudo global variable!
@clausjrgenahlerhansen1236
@clausjrgenahlerhansen1236 6 ай бұрын
@@RalphBacon Thank you Ralph😄
@lilbuzz999
@lilbuzz999 Жыл бұрын
Welcome back Ralph! Thanks for another great video. Happy Holidays (politically correct U.S. way of saying Merry Christmas) to you and yours.
@RalphBacon
@RalphBacon Жыл бұрын
Merry Christmas and A Happy New Year, in a totally non-PC UK way of wishing your the absolute best! 🎅🎄😁
@daveharris3384
@daveharris3384 Жыл бұрын
Welcome back.
@RalphBacon
@RalphBacon Жыл бұрын
And a Merry Xmas to you too! 🎄🎅
@computergururick
@computergururick 8 ай бұрын
Great explanation of pointers.
@RalphBacon
@RalphBacon 8 ай бұрын
Glad you think so!
@KaiseruSoze
@KaiseruSoze Жыл бұрын
I have had to use pointers when parsing a response from an http get. And when processing a packet from a TCP/IP response. A pain in the butt. Especially when dealing with big endians. I could have created a struct for each case, but I couldn't anticipate each case, so pointers.
@RalphBacon
@RalphBacon Жыл бұрын
Sometimes you have to grasp the nettle and do what must be done 😟
@Jibs-HappyDesigns-990
@Jibs-HappyDesigns-990 Жыл бұрын
hi Ralph...love U'r stuff.. so U'll REF an INT 2 make the VAR.....end.....An integer is a whole number that can be positive, negative, or zero....... In C language, a variable is the name of a memory location that is used for storing data...A variable is a characteristic that can be measured and that can assume different values.👀 U could have a sensor feeding int, then var would find a value. is there a print yet..& it proves that U'r stack will feed in the direction U want it to go...good luck O'l boy!!🌞🌻
@RalphBacon
@RalphBacon Жыл бұрын
Well, I'm sure that was crystal clear when you wrote your comment but I'm having a minor issue sorting the wheat from the chaff. But I'll accept your word on what you reckon is the best way to go! Merry Xmas, Happy Holidays! 🎄❄️☃️
@kentswanson2807
@kentswanson2807 Жыл бұрын
If you are sorting a bunch of data,, not a 1000 bytes, but even 5 or 10, but you have 50 of them. Wouldn't it be more economical to sort the pointers? Vs moving all those bytes around?
@RalphBacon
@RalphBacon Жыл бұрын
That depends on what the data is, Kent. A pointer is a two byte integer. If the data is bigger then, yes, it would be better to do so. But sorting character data is unusual; you would normally sort the index (which would probably be a one or two byte array). Very much depends on the application and data!
@jadus2198
@jadus2198 11 ай бұрын
Pointers can be useful if you are using for example an array of structs, but if you are using an array of structs and you need indexing or something like that, then you will probably know how to use it anyway's. I do a lot of programming in structured text, which is derived from C and CPP. I like the use of pointers in structured text a little more. If you declare a pointer for an integer, it is declared as ^INT (you see it is pointing to something). In the code, if you want the value of the pointer, the syntax is ^value, if you want the pointer address it is #value. If you think about it, # is the house and ^ is what is living under the roof. In C I always have to look it up to know if I have to use & or * although the syntax is the same, only different symbols. (matter of using it more often, I know).
@RalphBacon
@RalphBacon 10 ай бұрын
In short, pointers can be a minefield. Like a box of matches in the hands of a child. Ready to burn you (or the house down) if used incorrectly. There are doubtless scenarios where pointers would be useful but by the time you need that extra functionality I would think the expertise would be there too. I use pointers now and again - but try very hard to stick to C++ coding and not drop down to C constructs.
@lindsaymcphee2885
@lindsaymcphee2885 Жыл бұрын
As a predominantly VB6 programmer coming to c/c++/Arduino/esp32 pass byVal and pass byRef is familiar territory. The majority of texts and videos about pointers are far to verbose and over complicated, because they never show you the pass byRef syntax which would as you rightly say be enough for most people learning the language. I am now wondering whether Java and JavaScript have similar syntax.
@RalphBacon
@RalphBacon Жыл бұрын
Java is always Pass by Value. JavaScript too. Unless you are passing an object in which case it becomes a Pass by Reference, if you change the (underlying) members of that object. I believe there are some anomalies in both languages but I steer clear of those.
@sveinarsandvin6418
@sveinarsandvin6418 Жыл бұрын
Friendly explenation. Very good.
@RalphBacon
@RalphBacon Жыл бұрын
Many thanks!
@hansdegroot652
@hansdegroot652 2 ай бұрын
Yes missing ralphs vids here tooo are u ok and on sebatical?
@RalphBacon
@RalphBacon 2 ай бұрын
Yes, I am on a sabbatical; not sure when I will return but always plenty of things to talk about when I do. 👍
@hansdegroot652
@hansdegroot652 6 күн бұрын
Ok that's good to hear sad for us good for you I asume
@SprocketN
@SprocketN Жыл бұрын
I’ve done similar things but, like this: int a = 5; int b = 10; a , b = swap(a , b); int swap(a , b) { int temp = a; a = b; b = temp; return a, b; }
@K5HJ
@K5HJ Жыл бұрын
This won't work in C. You can only return a single value.
@SprocketN
@SprocketN Жыл бұрын
@@K5HJ Oops! I write programs in Python and several other languages (for fun). I often get mixed up with what each language can do. Thanks for correcting my mistake.
@RalphBacon
@RalphBacon Жыл бұрын
Yes, I read this last night and saw that it would never work, but by this morning @K5HJ has already written a response explaining all.
@EmbeddedEnigma
@EmbeddedEnigma Жыл бұрын
pointers are very usefull when interfacing with memory interfaces and stuff like that ;) nothing will replace pointers anytime soon in embedded .
@RalphBacon
@RalphBacon Жыл бұрын
There are always exceptions to the rule and this is doubtless one of them!
@rinokentie8653
@rinokentie8653 Жыл бұрын
Very useful, thanks!
@RalphBacon
@RalphBacon Жыл бұрын
Glad you liked it. And a Merry Xmas to you too! 🎄🎅
@TheUnofficialMaker
@TheUnofficialMaker 7 ай бұрын
will you be making anymore videos or are you done?
@RalphBacon
@RalphBacon 7 ай бұрын
Not done, exactly but certainly taking a break. Getting my life back! I've several topics in mind for future videos and I'm sure I'll eventually get the time to do the videos.
@TheUnofficialMaker
@TheUnofficialMaker 4 ай бұрын
@@RalphBacon ok excited to see what's next!
@andymouse
@andymouse Жыл бұрын
Howdy Ralph !
@RalphBacon
@RalphBacon Жыл бұрын
Dare I say "squeak"? Nice to see you here again!
@andymouse
@andymouse Жыл бұрын
Squeak !!@@RalphBacon
@jeremyyounger5442
@jeremyyounger5442 2 ай бұрын
hi mate you havent posted any videos for a long time is everything alright?
@RalphBacon
@RalphBacon 2 ай бұрын
Yes, I'm fine thank you, Jeremy but I am taking a bit of a longer break than anticipated!
@jasonlee3247
@jasonlee3247 Жыл бұрын
Back in the old days, Macintosh programming used handles which I believe were pointers to a pointer. Lots of double * in those days 😂
@RalphBacon
@RalphBacon Жыл бұрын
Hmm. Pointers to pointers still exist but, as you might imagine, I decided not to even mention them! 😆
@BER-UK
@BER-UK 2 ай бұрын
Hi Ralph, hope everything is OK, 9 months without a video is unusual.
@RalphBacon
@RalphBacon Ай бұрын
Unusual, true. But don't be concerned, I'm just taking a break from YT for a while, I need the rest!
@Tony770jr
@Tony770jr Жыл бұрын
Good point, no pun intended!
@RalphBacon
@RalphBacon Жыл бұрын
I won't reference your reply then 😲 in writing this response.
@ClaudeDufourmont
@ClaudeDufourmont 3 ай бұрын
Hello Ralph on ne vous voit plus, tout va bien ?
@RalphBacon
@RalphBacon 3 ай бұрын
Oui, je vais bien, merci. Je fais juste une petite pause sur KZbin. Merci de votre sollicitude.
@anispinner
@anispinner 3 ай бұрын
Glad everything is fine big dog. Enjoy some good times with whatever you're into nowadays
@Ed19601
@Ed19601 Жыл бұрын
Merry christmas
@RalphBacon
@RalphBacon Жыл бұрын
Thank you, to you too! 🎄🎅
@steverileyretired
@steverileyretired Жыл бұрын
Very Interesting
@RalphBacon
@RalphBacon Жыл бұрын
Glad you think so! And a Merry Xmas to you too! 🎄🎅
@hansdegroot652
@hansdegroot652 8 ай бұрын
Ralph where are youuuuu?
@RalphBacon
@RalphBacon 8 ай бұрын
I'm here somewhere... not sure where, right now. 🤷
@hansdegroot652
@hansdegroot652 6 күн бұрын
Are you comming back?
@TheRealNVT
@TheRealNVT 6 ай бұрын
Ralph, I hope you are ok, missing your content
@RalphBacon
@RalphBacon 6 ай бұрын
Whatever you do, don't unsubscribe or you will miss any future videos!
@zyghom
@zyghom 8 ай бұрын
where is Mr. Ralph???
@RalphBacon
@RalphBacon 8 ай бұрын
Taking a break from KZbin whilst I do LOTS of "other work". There simply isn't enough time in a day to do both right now.
@lilbuzz999
@lilbuzz999 9 ай бұрын
Ralph, is everything alright? Haven't heard anything from you in three months time.
@RalphBacon
@RalphBacon 8 ай бұрын
Yes, indeed, thanks for asking. Taking a bit of a break from the YT treadmill although I have been extremely busy and productive in the last few months. I might even make a video or two about what I've been building!
@lilbuzz999
@lilbuzz999 8 ай бұрын
@@RalphBacon, can't wait!
@digihz_data
@digihz_data Ай бұрын
Missing your videos too. 10 month break? Is the channel going to die?
@RalphBacon
@RalphBacon Ай бұрын
Die, you ask? Not at all, I'm just taking a sabbatical. In the meantime, many viewers are enjoying the videos already there!
@digihz_data
@digihz_data 21 күн бұрын
@@RalphBacon well, you do deserve a sabbatical Ralph. Marry Christmas and happy new year in advance. Hans
@RalphBacon
@RalphBacon 4 күн бұрын
Thanks, Hans, appreciated! And to you too, of course 🎄
@fredflintstone1
@fredflintstone1 Жыл бұрын
I can't see the point of this🙂
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Жыл бұрын
that's because you look more like a greyhound than a pointer. 🙂
@RalphBacon
@RalphBacon Жыл бұрын
It's the way you tell 'em, Barney!
@fredflintstone1
@fredflintstone1 Жыл бұрын
@@RalphBacon I do my best to bring Xmas cheer🙂
#BB7 Pass by Value or Reference - What's the difference?
16:35
Ralph S Bacon
Рет қаралды 14 М.
#BB10 Namespaces & Macros for Arduino (and other) microcontrollers
19:06
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 335 М.
Why I Use C | Prime Reacts
13:00
ThePrimeTime
Рет қаралды 187 М.
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 563 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 148 М.
#BB9 Organising your code🧹for easier debugging and maintenance✅
18:45
POINTERS in C++
16:59
The Cherno
Рет қаралды 1 МЛН
#BB4 MOSFETs - From an Arduino Perspective
15:10
Ralph S Bacon
Рет қаралды 23 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 841 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 214 М.
The Million view clip on China's Tiktok P2428 #shorts #gochannel
0:15
Go Channel TV
Рет қаралды 29 МЛН
Карина Кросс #shorts
0:16
Dolly and Friends Shorts Cartoons
Рет қаралды 361 М.
BIP HOUSE  .бип хаус 🥰🏡  #shorts
0:13
bip_house
Рет қаралды 1,2 МЛН
LOVE or MONEY? ❤️💸 (PART 14)
0:47
Alan Chikin Chow
Рет қаралды 3,5 МЛН
Лайфхак: Легально делать деньги
0:43