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
Amazon Auto Links: No products found.
seriously , you are the best teacher. i never listen so carefully 😛
thanks a lot
sir!
How can answer be assigned a value of 0 and then changed later? I thought that once you initialize a variable, that value is constant throughout that whole code?
That’s useful. Last time I wanted to add 1 to a variable I did this: variable = variable + 1;. This is a lot quicker and more useful.
a++ or ++a isnt changing nothing for me in my C.
Bucky: I REEEEEEEEEEAAAAAAAAAAAAAAAAAAAALLLLLLLLLLLLLLLLLYYYYYYYYYY like tuna
awesome tutorial keep it up!
Thank you bucky
BODMAS !!
So for those you don’t understand this let me explain in a better way. Read the comment line.
int a = 5, b = 10, answer = 0;
answer = ++a * b;
// (1+5) * 10 = 60
a = 5, b = 10, answer = 0;
// for a++ Bucky explain: Computer do 5 * 10 first, than ++
answer = a++ * b;
// If you add “+ a” at the end, Ex: a++ * b + a; the answer will be 56, once you type “+ a” and run it you will able to understand why a++ * b = 50
Because ++ is after “a” so 5 * 10 = 50. In this step ++ is not doing because it already end with the ; (Semicolon)
if you want “++” to do something add “+ a” at the end. than ++ will change a = 5 to a = 6
Hope I help you guys out
DUDE I’ve spent like 4 hours of my time on YouTube and not a single thing had I gained until I came by to your tutorial… You’re amazing!
Hey,Bucky great job man. I am learning c language quite fast. Thanx 🙂
I got it got it.
Hey Bucky ur Awesome…..
Plz keep up d good work
Great tutorials…..!!
Anybody can explain why a++ * 10 is still 50 on the screen?
because i think,
the calculation is already done right after the code “answer = a++ * 10 ;”
and the printf came after the calculation is done , which is supposed to print out “60”.
I still don’t understand,
hey bucky
why you don’t make advance tutorials series
instead of repeating the same series again and again
You know Bucky, you’re amazing.
If anyone is still confused, type this into your code:
int a = 5;
printf(“%dn”, a++);
a = 5
printf(“%dn”, ++a);
it gives warning : comparison of string literal leads to unspecified behaviour
This video is the living proof that Clicker Heroes is the easiest game to code
hey dude you’re reeeally a life saver THANNKS !!!!
When you went to Cracker barrel how was the service? Have you gone recently since they fired Brad’s wife? Has the service changed?
sir
instead of 1 incement how to incrrment 0.10?
it’s just today i found this videos and i hv more than 50 of them to download. i can’t start watching now cuz i hav to finish the download first but i really hope it will help me out
I was gonna say isn’t it because of order of operations why the second line equals 50? Because the ++ was on the right side of “a” meaning that it will be multiplied first before the 5?
i dont understand why do i have to copy the a and b values into the 2nd part i mean i havent changed them in any way
you are awesome i like your videos….thank you so much you videos are also so much help full…..
Oh.. I think bucky didn’t explain the ++ thing perfectly…
It’s mathematically simple :
Why a++ * b = 50 ?
a++ * b :::: means :::: a + 1 * b = 5 + 1 * 10 = 5 * 10 = 50
Multiplication first.
Is it necessary to put answer=0 .I mean how about only int answer; ??
thought it was my phone 🙁
What is your result and why it is?
void main(void)
{
int a,b;
a=3;
b=a++ + ++a;
printf(“%d,%d,%d,%d”,b,a++,a,++a);
getch();
}
Wonderful work, the simplest way to learn C… Thank you Bucky
i’m here now!!! yay!! lesson 24!!
Is it necessary to assign the value ‘0’ to the variable ‘answer’ in the first line? I tried the code without assigning 0 to answer and it worked fine