Added: 4 years ago
From: reconnetworks
Views: 125,366
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (500)

Sign In or Sign Up now to post a comment!
  • My code worked perfectly. And thank you for introducing this, lots of tutorial videos introduce little by little, but starting off with a "challenging" program for a first time user really teaches a lot. I learned a lot from this... not i need to master multiple functions :(

  • Hey , i followed your tutorial step by step , but after i calculate something and i say that i want do calculate again , it pauses and when i press anything exits the program .

  • thank you 

  • it says that all my case labels and my default label is not used within the switch but it actually is

    how can i fix it?

    i am using microsoft visual studio C++ express 2010

  • and that's why my teacher told me never to copy paste code :D

    

  • Just started a unit in college doing C++ using dev, I found this video very helpful and am glad you make mistakes. It got me of my ass and before actually following your full video I took the time to correct these mistakes, I also comment on my code as to what everything does and you explained everything in perfect detail thanks.

  • Thanks a lot! Now I have an awesome calculator.

  • and pause at 3:29 what symbol is that?

    where can i find that?

    thanks very much

  • @instaant1 The "or" operator? It's two vertical bars, just hold shift and press the backslash key.

  • @Ilikewatermelon27 kk thanks. i tought that was something else.

  • where did you put your cin >> dsecondnuber ?

  • hi there when i try to open my c++ shell it automatically close without doing anything what should i do??

  • i dont get it ...why must you even bother using || to replace "Or" ...c++ is seriously more complicated than visual basic,but C++ can achieve things which Visual basic cant

  • @imagination774 You can use the "or" keyword as a replacement for the "||" operator in C++.

  • nice tutorial.. and nice background music =)

  • Nice tutorial, I havent programmed in a few years, and need the brushup. Thanks for posting.

  • This is amazingly helpful! I actually figured out the errors you made whilst you were doing it... I was like, why has he put "de" instead of "d"?

    I also found that you didn't give the user the option to put in a second variable until later on which was kinda amusing... I mean what did you expect the program to do? Multiply the number by nothing? xD

    You made a few mistakes BUT, that's what testing and implementation is for I guess, I couldn't have taught it better!

  • I am getting ready to take a programming class at my school next term. Looking forward to it.

  • nvm i got it owrking was a problem with a previous file in my project

  • I finished everything properly using dev c++ but the curly bracket at start and end aren't working and its giving me 1 error every time about it please help

  • @mccreep100 me 2

  • I find it interesting that it's easy to catch another person's errors, but is an extreme pain in the rear to track down your own.

  • i noticed your desecond error from since you made it

  • @omgunoobinrs7 same lol

  • looks like you got your 1000 views ¬¬_

  • when I did this debugging I did what was standing on the txt but when I did that I said that I need to change to the sign that I had before, and so it goes... is there anything I could about it?

  • y did u stop makin the videos? u get so many views nd they r very helpful, they r real life saver.

  • @irtifakhan17 he forgot his youtube password...

  • Comment removed

  • mine says it expected ';' before the string constant in each line of output. soz im new to this

  • pls help me with my subj C++ pls....i need a tutor..text me im a pure blood filipino..09309425669

  • pls help me with my subj C++ pls....i need a tutor..text me im a pure blood filipino..09309425669

  • Nice !

  • it gives a bug when you fill in a string at the first double, and ti skips right to the "press any key" part

  • i am using code blocks.. and the system function is coming in as a error quoting

    "system" was not declared in this scope

  • @k666358 include cstdlib

  • @k666358 I know you've probably had this answered already, but the reasoning for that is Code::Blocks puts it in automatically and thus you don't need to do it yourself.

  • @k666358 i have the same problem....how can i fix it??

    i cant use any "system" declaration:|

  • the program won't let me enter the second number. why

  • Comment removed

  • @Ac3Shot1 type cin >> dsecondnumber;

    after the

    cout << "please enter the second number that you would like to use" << (+,-,/.,*) << endl;

  • Comment removed

  • Where am I going to get those 'or' symbols? :(

  • @TakingItCasual shift this \

  • @xXicedxXblue Thanks!

  • i get

     cin >> dfirstnumber;

    it tells me unexpected ending lols dosent makes sence

  • i did it!! i dedicate this ist application of mine..to u :) thx!!

  • Hah. This is a good tutorial for concepts, but damn...i get a lot of errors

  • Comment removed

  • WOO HOO GOT IT!!!!

  •  cin >> cChar;

    it says 'cChar' undeclared (first use this function)

  • @MrAMColes check you spelling

    it gets me alot

  • AHHHHHHGGGGGG every time i try to do this it screws up i try to run and compil and i get this in the error box thing : multiple definition of `main', first defined here, ld returned 1 exit status, C:\Users\Matthew\Desktop\C++ projects\Makefile.win [Build Error] [Untitled1.exe] Error 1, all in different boxing the same thing happend with the last tutorial im trying a different program or a different tutorial .......

  • fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source? wtf? anyone?

  • @Random3l1t3

    did you start the file with a precompiled header?

    if so try starting it as a blank program instead.

  • Thanks for the video! Did an awesome Job.

  • mine isnt working it says there is an error in one of the lines but i dont see the problem.

    cout << "the answer is: " << dfirstnumber << " + " << dsecondnumber << " = " << (dfirstnumber + dsecondnuber) << endl;

  • thank u

  • Why do you need all the curly braquets??????

  • Nice tutorial! Know any good books for starting c++?

  • Comment removed

  • Hi

    I am new to C++ will this work in Dev C++ as well, I mean will the same code work in dev C++ as well or will I have to modify the code.

  • @siddharthchauhan83 Yes it will work.

  • @siddharthchauhan83 i have the same question

    i typed it all out and i still have errors that he doesnt have

    and its typed the exact same way

  • @siddharthchauhan83

    I had to modify it a little bit:

    He had a '}' to much in about the 85th line, and he forgot to put ';' after 'endl' sometimes. After I corrected that it worked perfectly!

  • Comment removed

  • @Paalfaal you mean the 58th line right.??... cos there is no 85 line...this is confusing.

  • Hi

    I am new to C++ will this work in Dev C++ as well

  • actually mine came out perfect lol

  • lol!!! somehow i didnt get a build error xD

  • this program is lil bit complicated... i can't able to understand the use of CHAR, ENDL n almost the whole program is not understood by me... Sorry:( plzz someone guide me that how can i b good in c++///.... Thank you!

  • @FaDi1234567891011

    Char is the character on your keyboard. It's how you store it.

    endl is a function that ends the line on the console.

  • Very nice work! Thanks for posting this, and most more if you get a chance. Thanks!

  • Ok, I think it has been outdated and C++ is different from the commands he is showing you.... Damnit.

  • I came from Flash AS3 coding, and I find some of this very similar

  • PLEASE SHOW ME HOW TO PROGRAM A BINARY SEARCH TREE

  • @MrTech556 no, devc++

  • @wixiteam This isn't dev-c++.. in the first video was c++.. but this is visual c++ i think

  • I get an error saying:

    Cannot execute program.

  • Okay I fixed it. Now it is saying "system not declared in this scope"

  • Haha i did it and i'm in literature class. I used color #13 which is kinda cool :P

    !!!BTW Dude u forgot to put: "cin >> dsecondnumber;" without quotations, right under the "please enter the second number you would like to use" ..i knew it was missing while watching the video but i thought it's ok since it worked for u. Anyway these should help me alot into getting into the math-informatics class, cheers!

  • I keep getting the same three errors, and I've went over the video about 15 times, and checked my code, but it won't work. Can you help.

  • @ThePeaceTaco what error did you get?

  • @Isenhartanis I don't remember but, my computer just got hacked and i lost all my files, so if i wanted to look I couldn't anyway without restarting

  • @ThePeaceTaco that sucks, well starting over is a good way to practice.

  • @ThePeaceTaco Your fix is mentioned in the first half. Check the comments! xD

  • Lol I think I'll stay with .dll, .lua and .exe

  • hey so I'am using microsoft visual studo 2010 express. WHen i run debug i get error C2059: syntax error : '}', and the last } has a red line underneath, and when i remove it, I get fatal error C1075: end of file found before the left brace '{'

  • can someone answer this problem professional athletes earn a lot of money playing basketball at the PBA .their salary is subject to a 10% tax,write a program will ask for player's name and salary and then print the player's name,gross salary, the equivalent tax and the take home pay....PM me asap

  • @giever009 what exactly are you having problems with?

  • worked for me but can you have multi case ?

    like :

    case 'x' || '+' || 'X' :

    it didn't work for me :\

    and if you didnt break the cases you will get answer for all operations !

  • 28 `swicth' undeclared (first use this function)

    29 `;' before '{' token

    Can You Help Me Please :)

  • @loio10

    syntax error its switch not swicth

    good luck ^^

  • its ok guys, it has work after I'd fixed my errors

    (the output box on the bottom of the page really helps; just remember to click the lines of errors, it will tell you the problem and can give you the solution)

    its the box that says "SOW OUTPUT FROM: BUILD" (its in lower casing though)

  • Why is the part where it says "}else{" giving me errors when i typed it right?

  • Comment removed

  • @alienking2 i got a error at that part 2 but i removed it and it worked

  • I really like the way you explain the code Great job! ;)

  • case "+" ;

    Why is this an error?!

  • @TheTekhGeek it should be case '+'; not with the (") i had the same problem

  • Mine has 0 errors 0 warnings but when i try open it it says:

    Unable to start program

    The system cannot find the file specified,

    please help.

  • @Aidenization If you have a 64-bit operating system, then this is why. Its because this is designed for 32 bit.

  • @Justinarino56 could it be the reason why my program has 22 errors, I'm running visual c++ on windows 7 64bit

  • Good job men I like it

  • Comment removed

  • I have an error where it automatically enters 0 for my second number and then uses it. Can anybody help plz?

  • i did this exactly as you did and i got 60 errors, in dev c++ and microsoft visual

  • @umpalumpa101909

    Keep at it - its 10% enjoyment, 20% work, 70% debug pain, and 100% to remember the name. Only 60 errors? My first calculator had over 120 errors. Come on I believe in you, keep at it!

  • @FlamingPope i Love it, but Damn its alot of work :P

  • @umpalumpa101909

    Same for me

  • Hi can you help me plz, i got in error when compile and run in these lines cout << "The answer is:" << dfirstnumber << " + " << dsecondnumber << " = " << (dfirstnumber + dsecondnumber)

    What's wrong in these lines when compiling? sry i'm still learning c++

  • Comment removed

  • @TheDutchMagic you need to put << endl; after that

  • @Rawhesh Actually it is not necessary to put << endl; after each cout but it is nescessary to put ; after each line.

    @umpalumpa101909

    We can help you if you post the errors.

  • Does it matter if I create and compile this with Dev-C++

    cuz it's givin' me errors :S

  • will this compile and run in dev C++ bloodshed???

  • @samyung77 its done in that compiler, so ye it will run!

  • I LOVE Cplusplus!!

  • Love it

  • Will you be doing one which involves graphical output, lnes for instance ?

  • hello can somebody please help me i am getting error return 0; what is the problem

  • dudee, u r theee best!!!! keep up the great work!!!!! =D

  • can you send me the codes. OR in other word the sourrce. LIke copy and paste the whole thing. Please i really need help.

  • sure!

  • Why didn't you just use:

    switch(cChar)

    {

    case 'x':

    case 'X':

    case '*':

    // Multiplication code

    break;

    }

    Instead of repeating code?

  • @SaulR60 neat trick with the switch, I never knew you could do that, I should check that out

  • I tried this on dev c++ but when i wrote

    case '-' : ect.. and ran the program it said '-' not within switch statement

  • 72,612 views That's OVER 9000!!

  • omg i dont get the curly bracket thing when do u put them in? random?

  • @farestabs yes RANDOMLY place them all over the place... and DONT consult google.. itll tell you the same thing

  • shut the fuck up dude just cuz u no more than others doesnt mean you can be stuck up you bitch wooow what is up with people these days if you dont wanna answer my question then dont waste your time and reply!

  • @farestabs lol... all you have to do is a google search, thats it... there was no need to post that question... but hey srry if i offended you, lol

  • yea bro its all good but its annoying when u ask a question and someone so lamely states that he knows the material your asking about but wants to brag a bit thats all

  • try using dev-c++. this compiler works on vista

  • Great tutorial.

    May I suggest posting the code for somewhere for reference? The code on the video is a little hard to see. The colons look like semicolons, the curly-braces look like parenthesis, etc.

    I managed to figure it out. I'll definitely be checking out the rest of your tuts. Thanks for the killer tut.

  • with the IF case why do you use two equals signs before the 0 please ??????

  • @mrconcept

    The double equals is used as a relational operator when comparing two values/variables (if dsecondnumber is EQUAL TO zero) where the single equals is used for assigning values (such as b = 5).

  • It show me that cin >> cDoagain; isnt good whY!?

  • Great tutorial..only thing is make sure everyone knows that after a case and break to use a colon : and not a semicolon ;

    its hard to pick that up on the video. Great stuff otherwise. I would love to see you do a more advanced one on microcontroller programming with arrays if you had the time.

  • Break dont use a colon ( : ), it uses a semicolon ( ; )

  • Works perfectly! Thx! It was very helpful.

  • everything worked except that the title and color wont work in visual c++ 2008

  • i got this

    "Error2error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?Calculator.cppCalculato­r"

  • show me/us the sourcecode.

  • @wiesel12345 i figured it out. i didnt make it a win32 empty project... i feel dumb but thanks for the concern

  • desecondnumber =/= dsecondnumber

    Text fail :P

  • it still doesnt compile :( how do i make it compile?

  • ive done as it says and still it doesnt run :( it doesnt compile

  • @lillen300

    What compiler are you using?

    I use MS Visual C++ Express on Vista.

    Many of the compilers that work with XP aren't compatible with Vista or Win7.

  • Comment removed

  • @fireball31794

    If you want to use multiple cases in a single If statement use the 'or' operator which is represented by two vertical lines '||'

    if(number == 0 || number == 7 || number == 11)

  • hey man i created an artificial intelligence software using this! thx man! who ever wants to try it out message me and i'll give you the link to download it once everything checks out.

  • LOL 79 errors 2 fatal warning

    hehe

  • tnx bro! !

    ive got it just right!

    ur a great help

    eheheh

    :)

  • dude this video was posted two years ago its not happening

  • make your screen recorder a littlebit bigger so we can see a little bit more :) i still get error ive tried everything i can ;0

  • i think i mixed "{" "}" and "(" ")".

    Can someone who succeed copy the tutorial and send it with mail to me?

  • i got 14 error(s), 4 warning(s) !

  • what if they set the first variable to 0 making the division impossible to solve, how would you go about saying, if(dnumber2 == 0)

    AND

    if(dnumber1 == 0)

    ( cin >> "that is ect" >> endl;) else ect...

    would you just list in on the if statement with a comma? like

    if(dnumber2 == 0),(dnumber1 == 0)(cont...)

    or would it be somthing like and or an or

    if(dnumber2 == 0) and/or (dnumber1 ==0)(cont...)

    cause i have been needing to name multipul variables in if then statements and donno how

  • isn't it supposed to create an exe somewhere? it isnt for me.

  • How come I get 27 errors??! I did everything right.

  • To get CLEARSCREEN and COLOURS to work under BASH UNIX (Linux, Mac)

    Use cout << "\033]0;Calculator\007"; cout << "\E[32m";

    before the DO statement

    system("clear"); AFTER the opening do

    and: system("clear"); cout << "\033[0m"; cout << "\033]0;Terminal\007";

    AFTER the while statement

  • Line 73

    Calculator.cpp

    `Y' (and 'y') undeclared (first use this function)..

    How do I solve this? I use Dev C++

  • way does it does it show source file not compiled

    HELP!!!

  • even after i put in the cin >> dsecondnumber; below "choose your second number" it still says its "uncleared identifier"

  • You should surround your cases in braces ( { } ).

    It also makes things easier to read if you do it like this:

    case 'a':

    case 'A':

    { do.something();

    }

    the point of these brackets is two fold. It is to contain the code block, and also to let you line up the same tier of code (main being the first tier).

  • But its worth noting that surrounding them in cases in only really needed if you are declaring variables in the case statement.

    Although, I guess it could make things easier.

  • Huh? I may only have 3 years of programming experience, however, it is much easier finding errors in code when it follows certain rules. It is also much easier (in my opinion), to understand the flow of the code when code blocks are contained and tabbed properly.

  • Im just saying, as a technicality, thats all. Really, its no reflection on your abilty.

  • any1 know a string of code that can stop the program chocking if u use a character in the interger selection?

  • I dont get it, my calculator works, I type the number 2, and then I type +, then it suddenly just goes 2+5.21242e+291 = 5.21242e+291

    Would you like to start again? (y or n)

  • oh after the "Put in the second number" you need to put in:

    cin >> dsecondnumber;

    The same thing happened to me :D.

  • lol next video after 1000 views xD

  • I cringed when I saw you add the "e" in dsecondnumber.... I was screaming at the monitor hoping you would see it, lol.

  • nothing bad on his part (im trying to learn this too) but this tutorial i found online is sorta different from what he's telling me and I am soooo confused, can anyone tell me where I went wrong, as in, was I supposed to have previous knowledge of C++ before? Some of the things he says were in the tutorial i read, but theres some different things

  • hes right