Save this video free

Lecture 15: Introduction to C

Burton Ma · 44:33 · Watch on YouTube

Part of Queen's University CISC220. See all 23 lectures and search them

These notes were made with YouTube Collector. Paste any YouTube link and get the same: a summary, chapters and a searchable transcript.

Overview

Burton Ma closes the Bash unit by explaining why arrays do not pass to functions like ordinary values and how Bash 4.3+ namerefs can pass them by name. He then introduces C: its history and performance-focused design, common uses, source and header files, compilation with GCC, and the roles of preprocessing, `main`, and exit status.

Key takeaways

Chapters

0:00 Passing Bash Arrays to Functions with Namerefs
6:40 Bash Test Preparation and Practice Materials
10:00 C as a Compiled, General-Purpose Language
13:35 C's Origins, Design Priorities, and Slow Evolution
20:00 Where C Is Used: Operating Systems, Embedded Devices, and Libraries
22:57 C Development Tools, Source Files, and Hello World
30:21 Compiling C Programs with GCC and Naming Executables
36:32 C Preprocessing, `main` Signatures, and Exit Status

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 There's one last thing I want to talk about in Bash before we move on to the next major part of the course. And so we were talking about the last topic we talked about in Bash was writing functions. So there's a peculiar peculiarity in Bash in that you cannot pass an array to a function. Sorry, well you can but we haven't I haven't shown you how to do it. So here's a little Bash script that tries to pass an array to a function. So here's my function use array. Now remember if you're going to if a if a function has some arguments the arguments are stored in the special parameters 1 2 3 4 and so on. So I'm going to try to pass an array to

0:47 this function and I'm going to pass I'm going to try to access that array using special parameter number one. And all I'm going to do is I'm going to print the length of the array. So remember that's how you get the length of an array. And I'm going to pass a non well I'm going to pass a what I think is a non-empty array to the function and I'm going to try to print the first element. So there's my array. It's just the array 1 2 3. And now this might be your first hint that there's a problem passing arrays to functions. And so remember if you want to pass a value to a function normally you would have to write dollar you need to you need to write dollar in front of the parameter in certain front of the variable name sorry. Because you want to pass the value of that thing to a function.

1:35 And so the question is is what the heck

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

In this course

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Burton Ma.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.