From the course: C Standard Library
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Memory chunk operations example - C Tutorial
From the course: C Standard Library
Memory chunk operations example
- [Instructor] So once more, here we have an example where I have a lot of codes already written down for you, and I will show you the lines where I have to fill in with the functions I want to illustrate. These are memset and memcopy. So first in line five we have definition for a constant, array size. That's the size of the array, defined in line 14, which is a byte array, and those bytes are unsigned integers. But remember, they are bytes. And my use of the memset function will be to initialize that whole array to zero, and for memcopy, I will copy one variable to another, but this won't be regular variables, but compound variables. I'm talking about the type definition in line seven, which is a structure that contains an integer X and a character C. So it has two fields and this structure is called my pair. That's the type definition I just defined. And so let's take a look at the main function. So starting at line 13, we have a definition for two variables of that type, my pair…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
String manipulation1m 21s
-
(Locked)
String manipulation example2m 3s
-
(Locked)
String examination1m 43s
-
(Locked)
String examination example8m 5s
-
(Locked)
Memory chunk operations43s
-
(Locked)
Memory chunk operations example5m 13s
-
(Locked)
Challenge: Find a special word59s
-
(Locked)
Solution: Find a special word6m 25s
-
-
-