C Programming Tutorial – 54 – Functions

Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Comments

Matt Elliot says:

in order to see your codes i have to run this video at least 1080p HD. could you write your codes bigger?

BEST_NOOB_BG says:

Много поздрави на Бананкин.
Го тура на майка ти.

Pavan Kumar says:

what is the software you are using for compiling?I am not cs student.i am beginner

joshua gollaher says:

He showed how to use pointers before how to declare functions…..

hurrdurr25 says:

I got an A- in my C class partly thanks to your tutorials. Very helpful.

Viet Hung says:

thanks youuuuu <3

Baudshah Suleymon says:

this was good bro

ashim bose says:

okay.. la laa laaaa.. 0.. 😛

Nikos Tsakas Jr. says:

How come this worked anyway when I ran it without typing “void printsomething();” before main()?

zhentrix calipso says:

I remeber nothing on our lecture lel..

S B says:

Need to zoom in more next time, please! Otherwise, thank you!

Poor Judgement says:

how can you execute several different functions in random order?

Marie-Louise Johansson says:

I felt like such an idiot after our c-class today. After watching this video I’m back on track again! Thanks for explaining all this in a way that my teacher couldn’t: A way that I could get my head around. ^^

Ritesh Unknown says:

Which software are you using ?

carcez says:

DOES ANYONE KNOW THE DIFFERENCE BETWEEN VOID FUNCTION and VOID* FUNCTION.?

Youssef Arafat says:

I studied assembly like three years ago and I remember studying interrupt in real time system also, from these two I remember that compiler actually reads the entire code first and then it goes line by line. This means I don’t have to give the code a heads up that a function is going to be used in the main.
I’m not quite sure if this applies here or not, but I think it is the same concept so if anyone can either consolidate that or disprove it that’ll be awesome. By the way, these were quite awesome videos I learned a lot from them, thanks, Bucky!

viewsPref says:

if anyone can’t understand this tutorial, please don’t say you can’t programming but you have no learning ability at all.

Sven Ben says:

if voiding the function basically says its not going to return anything, what is the point of having return in the function?

Lorda Laurent says:

you are a life saver!, I swear you are like the patrickjmt for computer programming:), you make concepts seem very easy. Patrickjmt Make Calculus concepts easy grasp:)

shaffi rappi says:

i cant see your coding properly could you use magnifers at different intervals in your videos please ?

smit patil says:

Hey!! Void function don’t return anything.Thus we don’t need to write return; in void functions.

Rosaline Cabrera says:

Awesome! My textbook’s explanation of functions were way too complicated. You simplified it so well, thank you so much!

Braden Best says:

Actually, you _don’t_ have to return anything in a void function. That’s kinda the whole point. It doesn’t return anything, it just does stuff, because void “functions” aren’t functions. They are methods, or subroutines. You should only call return in a void function if you need to exit prematurely. Otherwise, let it return by itself.

The kind of function you’re thinking of is an int, which returns an exit status so you can determine that it failed before continuing on and messing things up.

The most common example of that is main(), which is supposed to return 0 to indicate that it ran successfully, but you can also exit with a different status to indicate a failure. For example, http://pastebin.com/iyssUkzf. In the example, if you fail to pass any arguments to the program, it will exit with 1 and print the usage string to stderr. Otherwise, it will exit successfully.

If you try this in a commandline (I’m using bash)…

./my_program && echo success! || echo failure!

will print “failure!”, but

./my_program obligatory_argument && echo success! || echo failure!

will print “success!”

entschuldigung says:

void functions don’t need a return.

aldailami abdullahhussein says:

very sweet bucky thank you

Sean Ashcraft says:

jesusss fuck, i wish it was this easy.

DrDrewsAdventures says:

Couldn’t you just swap the function part with the main and not need to add the prototyping to your function??

Alexis Marcelo says:

What program are you using???

Jordan Chow says:

thanks! you are way better than my lecturer!

Siphelele Shabalala says:

durr Bucky is a function.

Anas Dallah says:

PSUT :)

RandomnessPersonified says:

Durr I’m a function

J M says:

Damn dude thank you. I’m doing school online and the downside is trying to interpret a text book explanation of how to do something simple. After watching your tutorial I totally understand what a function is and how it’s used I just needed it in plain English thank you again

hkk says:

hi everyone , does any one knows why this function is not working , it should count the words of a string 
void A ( char a[] )
{
     int j ,n, i;
     i=0;
     j=0;
     while ( a[i] != ‘’)
           {
                 while ( a[i] == ‘ ‘)
                 {
                         i++;
                 }
                 if ( a[i] != ‘ ‘)
                  {
                        j++;
                       while (a[i] != ‘ ‘)
                       {
                              i++;
                        }
                  }
             }
     printf (“%d”, j);
}

GaminFreak! says:

Thanks +thenewboston 

Muhamad Rizky says:

whoa,,,, this is the best channel to learn C programming. Very good explanation. Thanks man, subscribed :)

Write a comment

*

Human Verification: In order to verify that you are a human and not a spam bot, please enter the answer into the following box below based on the instructions contained in the graphic.


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!

Send this to a friend

▷ Other ReviewsVehicles▷ Show Cars▷ Motorbikes▷ Scooters▷ Bicycles▷ Rims & Tires▷ Luxury BoatsFashion▷ Sunglasses▷ Luxury Watches▷ Luxury Purses▷ Jeans Wear▷ High Heels▷ Kinis Swimwear▷ Perfumes▷ Jewellery▷ Cosmetics▷ Shaving Helpers▷ Fashion HatsFooding▷ Chef Club▷ Fooding Helpers▷ Coktails & LiquorsSports▷ Sport Shoes▷ Fitness & Detox▷ Golf Gear▷ Racquets▷ Hiking & Trek Gear▷ Diving Equipment▷ Ski Gear▷ Snowboards▷ Surf Boards▷ Rollers & SkatesEntertainment▷ DIY Guides▷ Zik Instruments▷ Published Books▷ Music Albums▷ Cine Movies▷ Trading Helpers▷ Make Money▷ Fishing Equipment▷ Paintball Supplies▷ Trading Card Games▷ Telescopes▷ Knives▷ VapesHigh Tech▷ Flat Screens▷ Tech Devices▷ Camera Lenses▷ Audio HiFi▷ Printers▷ USB Devices▷ PC Hardware▷ Network Gear▷ Cloud Servers▷ Software Helpers▷ Programmer Helpers▷ Mobile Apps▷ Hearing AidsHome▷ Home Furniture▷ Home Appliances▷ Tools Workshop▷ Beddings▷ Floor Layings▷ Barbecues▷ Aquarium Gear▷ Safe Boxes▷ Office Supplies▷ Security Locks▷ Cleaning ProductsKids▷ Baby Strollers▷ Child Car Seats▷ Remote ControlledTravel▷ Luggages & Bags▷ Airlines Seats▷ Hotel Rooms▷ Fun Trips▷ Cruise Ships▷ Mexico Tours