How to write C functions with variable argument lists.

preview_player
Показать описание
---

A lot of students don't realize that they can make variadic functions—functions that take a variable number of arguments—like printf in C. This video shows you how.



***

Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.

About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.

More about me and what I do:

To Support the Channel:
+ like, subscribe, spread the word

Want me to review your code?

You can also find more info about code reviews here.
Рекомендации по теме
Комментарии
Автор

As I learn more and more about C I notice that it was ahead of its time.

ゾカリクゾ
Автор

I am surprise that this video doesn't have many views because is SUPER interesting and is not a content easy to find.
Thank you Jacob!

Thiagola
Автор

I already knew about that topic and how to do that but watched the video anyways and I am struck with how concise, breve and clear it is, definitely great content for beginners and I wish such content would have existed when I learnt that.

arnaudparan
Автор

Wow, I always imagined how it worked. Today I found it. Keep up the great work.

ravimali
Автор

2:23: "...must also be self-promoting types, so you *can't use chars*, shorts or floats... but ints doubles or pointers are just fine."
NB: We might want to note here that char pointers (char *) are also fine, since they count as pointers in this line-up.

ropersonline
Автор

I need to create a logging system and this is just what I needed! Thanks so much!

immanuelcharles
Автор

I am a Cpp developer and never thought I would come across a use case where I will be needing this so never learned this.

Today I came across a crash and have to use it and was looking for some easy and to the point tutorial, came across this one.

Thanks for such a great video.

atulrustagi
Автор

your typing is somehow so satisfying !!

ArmiaKhairy
Автор

Thanks for the tutorial Jacob! I look forward to seeing more :)

thebuilderr
Автор

This is really amazing and straight to the point. Thank you Jacob. I'm going to try writing my own printf fuction.

idrisabdullateef
Автор

Thank you Jacob, this was the best explanation ever

abijith
Автор

// While practicing functions, I encountered an error. Can you explain why?

// I tried using `void` as an argument in the function call.
// Why can't `void` be used this way, and what is the proper way to call a function that takes no arguments?

void myFunction(void) {
// Function body
}

int main() {
myFunction(void); // Why is this incorrect?
return 0;
}

ramakrishna
Автор

Am i right assuming that printf counts the % placeholders in the string to know how many extra arguments were passed?

TheVertical
Автор

Mr. Jacob can you longer videos on variadic functions

theblackelephant
Автор

your video is not for beginners. I always see your video, and I never understand what you teach despite compiling a great lecture in amazing way. The problem is that we beginners need detailed information to infer the concept. You are great teacher, and try to consider tyros

nathanassefa
Автор

This channel deserves more subscribers! :)

laurisskraucis
Автор

Thanks, you helped me a lot to understand this topic!

Tachiguro
Автор

Your explanation is amazing but I expected the video to be more longer then 4 minutes I like to have good understanding with longer explanation that answers all questions about the subject.

creative_tech_shorts
Автор

I love you explanation, keep the energy up! could you please do a video to explain the printf code in its entirety?

D_Ladybug
Автор

When I see how variable number of arguments is done in C, I appreciate this feature in Python more. If this is builtin, it makes it so much more easy and natural to work with. Currently learning Rust here and Rust doesn't have it too as a language construct.
If you wonder why I watch your content, even if I am not a C programmer and interested in Python and Rust only. It is because your content is so good and also why not learning a bit about C alongside. C is universal.

thingsiplay
visit shbcf.ru