Visual C++ 2010 Tutorial 5 - Passing Variables

preview_player
Показать описание
pm me with questions or requests
Рекомендации по теме
Комментарии
Автор

I'm picking up C++ very quickly thanks to your help. I just graduated with an A.A.S. in Computers and in between looking for a job, I'm trying to pick up even more knowledge in the computers area. I did pretty well in Java and that's also probably why I'm soaking this up pretty quickly. I just want to say thanks because you writing and explaining is so much better than reading a book!

VeggieTrunks
Автор

nevermind the 2 other messages about the error code i found out what i had done wrong, i have watched tutorial 1-5 and i have learned a lot so keep up with the good work man!!!!

Ibanez
Автор

You're a great teach. If you don't yet 'lecture' professionally you should understood every thing so far thank God.

josiahtobas
Автор

Thanks alot for these tutorials, they help out alot!

hel
Автор

Hey man, Please tell me how you record such a nice and clean voice for your videos...

satendrakumarMATLAB-TUTORIALS
Автор

these have been real helpful man, quick question, though, when im finnished making a dosbox what do i save it as so it will just open the program, not the code?

ninjax
Автор

So with declaring int x and int y specifically in the int Addition method, could we assign x and y again as different values in the void main? Or does one int get declared for the whole program?

nuggetslug
Автор


Those who need Help:- -
 ok so other than the # portion lets say there is 3 sections alright.
 1st section being
 int Addition(int x, int y);
 
 this is declaring the x and y interger as if u were to declare that I want to create a variable like usernum1, and usernum2 which these variable used in sec 2.
 Skip sec 2 and go to sec 3.
 
 int Addition(int x, int y)
 {
  int userAnswer;
  userAnswer = x + y;
  return userAnswer;
 }
 what this is doing is like declaring a formula you want. Ex. if u go to math class have a problem which is sec2, you have to figure out which Formula to use, once u found that then you can plug in the Numbers as in Sec. 2
 
 Imagine the Sec.2 your piece of paper and sec1 just letting pc know that your going to input 2 numbers for the formula which in return it gives you an answer.
 
 Now for Sec.2  like always declare the variables, it prints u input, then from both the
 userName1, and userName2 is now declared to be with
 Addition(userName1, userName2) AKA it = to Addition(int x, int y)
 SEE!!!
 Then the easy part again it shows the String and then the final answer which is
 Addition(userName1, userName2)
 Thumbs up for others to see
 100% Should help

darodism
Автор

Can I ask what the x and y are for? I'm confused as to how they relate to userNum1 and userNum2. Like how does the Addition method know to use userNum1 and userNum2 for 'x + y'? cheers!

dzeromon
Автор

After watched this video... I got a question:
After the debug, the program only read the function "Void Main(){ "until "_getch();}".
So what is the purpose of "int Addition(int x, int y);"??

tingxyu
Автор

I can't figure out what I did wrong when creating a similar application for practice....

PwndByChips
Автор

This is getting confusing for me, lol ill try to understand it -_-, but ur a great teacher, master xD

artificialastronomers
Автор

Tell me, whats the point of summing x and y in Addition, if you just show them again in main sub (or what ever its called in C+), How can i return the userAnswer, and get the functions Addition result in main ??? Please reply..

ExEdzy
Автор

for some reason my program immediately closes after it performs the addition method and my code is exactly like his.

bikeous
Автор

@ninjax261 i think you save it as .bat.. not sure but ill try or u can

zzdasdasd
Автор

Awesome tutorial, just 1 small thingy lol... you say:



addition(userNum1, userNum2);
cout << "The numbers added equals: " << addition(userNum1, userNum2) << endl;

But you dont need to do the first one since you parsing it in the cout (character output?) right?

Might confuse people lol, keep up the good work its awesome!

Devbizz
Автор

I got this error message and i have written all the stuff correctly, the error code say's that the function does not take 2 arguments. help plz?

Ibanez
Автор

Nvm i just entered system("pause") and that helped.

bikeous
Автор

Can i see your code, please? I think you misspelled something.

riseandrule
Автор

Tell me, whats the point of summing x and y in Addition, if you just show them again in main sub (or what ever its called in C+). The code, to mach your title of video should be:
cout << "The answer is " << Addition(Answer);

Im i right?

P.S. Previous comment dosn't count :D

ExEdzy
visit shbcf.ru