Skip to main content

Posts

Showing posts from March, 2018

Udemy - advanced c programming pointers - Addresses and Indirection

Udemy - Advanced c programming pointers - Addresses and Indirection What is the relationship between a pointer and an array (or string)? Transcription : Arrays in C are actually just sequential data items stored at some location in memory the address of the array is the same as the address of the first item in the array because it is where the array begins. The name of the array that is the name you get to the array variable is also the address of the array.  To explain this let's look at how strings are used in C unlike many other languages. C does not have a dedicated string data type in C A string is just an array of characters for convenience C treats the null character Slash's zero as the string Terminator. When you declare a string variable like this C automatically ODs a null char at the end. Now let's see if we can find where this string is stored in memory. Now here's my program and here you can see that I've just created a string hello world whi...

Udemy - advanced c programming pointers - Addresses and Indirection

Udemy - Advanced c programming pointers - Addresses and Indirection What is the relationship between a pointer and an array (or string)? Transcription : Arrays in C are actually just sequential data items stored at some location in memory the address of the array is the same as the address of the first item in the array because it is where the array begins. The name of the array that is the name you get to the array variable is also the address of the array.  To explain this let's look at how strings are used in C unlike many other languages. C does not have a dedicated string data type in C A string is just an array of characters for convenience C treats the null character Slash's zero as the string Terminator. When you declare a string variable like this C automatically ODs a null char at the end. Now let's see if we can find where this string is stored in memory. Now here's my program and here you can see that I've just created a string hello world whi...

Udemy - advanced c programming pointers - Pointer Basics

Udemy - advanced c programming pointers - Pointer Basics What is this course about ? Transcription : Welcome to this c course on pointer's before we get started let me say a bit about who this course is for what you get out of it. Now let me be clear I'm assuming you already have at least some experience of programming in C before you start this course. This is definitely not a course for beginners. You need to know at least the basics of C programming syntax how to write functions parse arguments how to edit and compile C programs. You may also have at least some experience of using pointers but that isn't essential if you are completely new to see where I already have another course on C programming for beginners. And that's why you should start this course is more advanced. It explains pointers in depth in the early stages I'll explain what pointers are and how to use them. I'd explain addresses and in direction allocating and freeing memory pointer...