Your Fifth Day in C (Understanding C Strings) - Crash Course in C Programming

Published: 30 January 2022
on channel: Mike Shah
2,785
103

►C Programming playlist:    • C Programming Series  
►Find full courses on: https://courses.mshah.io/
►Join as member to get perks:    / @mikeshah  

►Lesson Description: In this series of lessons I provide you with a crash course in the C programming language. In this lesson I will discuss how strings are represented in the C language. In addition, I'll also talk about the difference between a C string and a String literal. Throughout this discussion we will learn about some of the important C library string functions, implement two of them from scratch (strlen and strcat), and then wrap up discussion showing why it is important to have a null terminating byte your C strings.

00:00 Introduction
00:47 C-strings are an array of characters
01:58 The Null terminating byte
3:33 Modifying characters in the C-string (i.e. character array)
5:40 Exercise: Writing a string length function
8:20 The strlen function in string.h
9:30 'const' in C
10:58 size_t datatype in C
12:35 Working with a dynamically allocated string with malloc (i.e. char*)
14:55 String Literals in C
16:30 C puts in the null terminator for string literals
17:03 String literals are read-only
21:52 Exercise: Writing a string append function
31:57 Bug fixes and a refresher on pass-by-value
34:55 A working ''StringAppend'' function demo
35:34 Comparing our StringAppend with strcat in C Standard Library\
36:36 Refactoring our StringAppend
40:05 Simplifying our StringAppend with realloc
44:45 Improving our StringAppend performance with memcpy
47:20 What happens without the Null Byte?
50:20 Review on temporary, stack allocated memory
52:03 Wrap up and Conclusion

►Please like and subscribe to help the channel!
►YouTube Channel:    / mikeshah  
►Join our free community: https://courses.mshah.io/communities/...


Watch video Your Fifth Day in C (Understanding C Strings) - Crash Course in C Programming online, duration hours minute second in high quality that is uploaded to the channel Mike Shah 30 January 2022. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,785 times and liked it 103 visitors.