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 .
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.
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
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 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
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?
@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.
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?
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!
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!
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
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)
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!
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++
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!
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
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.
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).
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.
"Error2error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?Calculator.cppCalculator"
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.
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).
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.
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
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 :(
CramperHunter 4 days ago
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 .
MegaStyle971 3 weeks ago
thank you
Ch33ser3aper 1 month ago
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
quagpwn 1 month ago
and that's why my teacher told me never to copy paste code :D
PaperBrain1 1 month ago
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.
NexuSpiire 1 month ago
Thanks a lot! Now I have an awesome calculator.
wyrrox 2 months ago in playlist More videos from reconnetworks
and pause at 3:29 what symbol is that?
where can i find that?
thanks very much
instaant1 2 months ago in playlist More videos from reconnetworks
@instaant1 The "or" operator? It's two vertical bars, just hold shift and press the backslash key.
Ilikewatermelon27 2 months ago
@Ilikewatermelon27 kk thanks. i tought that was something else.
instaant1 2 months ago
where did you put your cin >> dsecondnuber ?
instaant1 2 months ago in playlist More videos from reconnetworks
hi there when i try to open my c++ shell it automatically close without doing anything what should i do??
eljazzero23 2 months ago
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 2 months ago
@imagination774 You can use the "or" keyword as a replacement for the "||" operator in C++.
Ilikewatermelon27 2 months ago
nice tutorial.. and nice background music =)
vojak007 3 months ago
Nice tutorial, I havent programmed in a few years, and need the brushup. Thanks for posting.
DukeNukem65 3 months ago
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!
W0lfbaneShikaisc00l 3 months ago in playlist More videos from reconnetworks
I am getting ready to take a programming class at my school next term. Looking forward to it.
burtdga 3 months ago
nvm i got it owrking was a problem with a previous file in my project
mccreep100 3 months ago
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 3 months ago
@mccreep100 me 2
migell 3 months ago
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.
Adrammalech7570 4 months ago
i noticed your desecond error from since you made it
omgunoobinrs7 4 months ago 23
@omgunoobinrs7 same lol
craig041204 4 months ago
looks like you got your 1000 views ¬¬_
brandrocks 5 months ago
This has been flagged as spam show
does he have a new channel or something?
irtifakhan17 5 months ago
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?
solan3999 6 months ago
y did u stop makin the videos? u get so many views nd they r very helpful, they r real life saver.
irtifakhan17 6 months ago
@irtifakhan17 he forgot his youtube password...
CheeseToastHax 5 months ago
Comment removed
3x3ls10r 6 months ago
mine says it expected ';' before the string constant in each line of output. soz im new to this
Draiko1111 7 months ago
pls help me with my subj C++ pls....i need a tutor..text me im a pure blood filipino..09309425669
ihateyoueternity 7 months ago
pls help me with my subj C++ pls....i need a tutor..text me im a pure blood filipino..09309425669
ihateyoueternity 7 months ago
Nice !
DeviLzRO 7 months ago
it gives a bug when you fill in a string at the first double, and ti skips right to the "press any key" part
NebulaOrbit 7 months ago
i am using code blocks.. and the system function is coming in as a error quoting
"system" was not declared in this scope
k666358 7 months ago 7
@k666358 include cstdlib
InnerFood 2 months ago
@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.
OptimisedGaming 1 month ago
@k666358 i have the same problem....how can i fix it??
i cant use any "system" declaration:|
arhanghel111 1 month ago
the program won't let me enter the second number. why
Ac3Shot1 7 months ago
Comment removed
Jessebear998 7 months ago
@Ac3Shot1 type cin >> dsecondnumber;
after the
cout << "please enter the second number that you would like to use" << (+,-,/.,*) << endl;
1995govand 7 months ago
Comment removed
xXicedxXblue 8 months ago
Where am I going to get those 'or' symbols? :(
TakingItCasual 8 months ago
@TakingItCasual shift this \
xXicedxXblue 8 months ago
@xXicedxXblue Thanks!
TakingItCasual 8 months ago
@xXicedxXblue np
xXicedxXblue 8 months ago
i get
cin >> dfirstnumber;
it tells me unexpected ending lols dosent makes sence
TheCTone 8 months ago
i did it!! i dedicate this ist application of mine..to u :) thx!!
MegaBhatti1987 8 months ago
This has been flagged as spam show
Hah. This is a good tutorial for concepts, but damn...i get a lot of errors
PhxPride1 9 months ago
Hah. This is a good tutorial for concepts, but damn...i get a lot of errors
PhxPride1 9 months ago
This has been flagged as spam show
lol i got like 20 errors, even if i did the same as you did :)))
valentass88 9 months ago
Comment removed
valentass88 9 months ago
WOO HOO GOT IT!!!!
Taimoorabdullah 10 months ago
cin >> cChar;
it says 'cChar' undeclared (first use this function)
MrAMColes 11 months ago
@MrAMColes check you spelling
it gets me alot
MrCycloneful 10 months ago
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 .......
pablo0rodregace 11 months ago
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 11 months ago
@Random3l1t3
did you start the file with a precompiled header?
if so try starting it as a blank program instead.
TheMO14 11 months ago
Thanks for the video! Did an awesome Job.
AcidorUtopia 11 months ago
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;
esotericfilms 11 months ago
thank u
thejeminitube 1 year ago
Why do you need all the curly braquets??????
zeldawind6 1 year ago
Nice tutorial! Know any good books for starting c++?
chrisw142 1 year ago
Comment removed
RabidMonkey303 1 year ago
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 1 year ago
@siddharthchauhan83 Yes it will work.
JacobTSnyder96 1 year ago
@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
darktitan33 1 year ago
@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!
Paalfaal 1 year ago
Comment removed
siddharthchauhan83 1 year ago
@Paalfaal you mean the 58th line right.??... cos there is no 85 line...this is confusing.
siddharthchauhan83 1 year ago
Hi
I am new to C++ will this work in Dev C++ as well
siddharthchauhan83 1 year ago
actually mine came out perfect lol
DrLooongcat 1 year ago
lol!!! somehow i didnt get a build error xD
DrLooongcat 1 year ago
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 1 year ago
@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.
giacomand 1 year ago
Very nice work! Thanks for posting this, and most more if you get a chance. Thanks!
mathlover111 1 year ago
Ok, I think it has been outdated and C++ is different from the commands he is showing you.... Damnit.
DualKong 1 year ago
I came from Flash AS3 coding, and I find some of this very similar
mikeccuk2006 1 year ago
PLEASE SHOW ME HOW TO PROGRAM A BINARY SEARCH TREE
Yeowoh 1 year ago
@MrTech556 no, devc++
wixiteam 1 year ago
@wixiteam This isn't dev-c++.. in the first video was c++.. but this is visual c++ i think
VendectaSplitter 1 year ago
I get an error saying:
Cannot execute program.
PMontanaro5 1 year ago
Okay I fixed it. Now it is saying "system not declared in this scope"
ThePeaceTaco 1 year ago
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!
UnrealZmeu 1 year ago
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 1 year ago
@ThePeaceTaco what error did you get?
Isenhartanis 1 year ago
@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 1 year ago
@ThePeaceTaco that sucks, well starting over is a good way to practice.
Isenhartanis 1 year ago
This has been flagged as spam show
@Isenhartanis Okay I fixed it. Now it is saying "system not declared in this scope"
Can you help with that? I know i can get rid of it but, the extra features wouldn't be there and the screen wouldn't clear.
ThePeaceTaco 1 year ago
@ThePeaceTaco Your fix is mentioned in the first half. Check the comments! xD
TruthWithReason 1 year ago
Lol I think I'll stay with .dll, .lua and .exe
monstergarage2 1 year ago
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 '{'
demonshebaz 1 year ago
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 1 year ago
@giever009 what exactly are you having problems with?
SuperFeimer 1 year ago
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 !
gravexx 1 year ago
28 `swicth' undeclared (first use this function)
29 `;' before '{' token
Can You Help Me Please :)
loio10 1 year ago
@loio10
syntax error its switch not swicth
good luck ^^
gravexx 1 year ago
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)
BLESSMAN11 1 year ago
Why is the part where it says "}else{" giving me errors when i typed it right?
alienking2 1 year ago
Comment removed
ryzom125 1 year ago
@alienking2 i got a error at that part 2 but i removed it and it worked
linkz98 1 year ago
I really like the way you explain the code Great job! ;)
dannika1983 1 year ago
case "+" ;
Why is this an error?!
TheTekhGeek 1 year ago
@TheTekhGeek it should be case '+'; not with the (") i had the same problem
blinddevil10 1 year ago
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 1 year ago
@Aidenization If you have a 64-bit operating system, then this is why. Its because this is designed for 32 bit.
Justinarino56 1 year ago
@Justinarino56 could it be the reason why my program has 22 errors, I'm running visual c++ on windows 7 64bit
BLESSMAN11 1 year ago
Good job men I like it
lordzzcabe 1 year ago
Comment removed
darksolace84 1 year ago
I have an error where it automatically enters 0 for my second number and then uses it. Can anybody help plz?
julibeemcdee 1 year ago
i did this exactly as you did and i got 60 errors, in dev c++ and microsoft visual
umpalumpa101909 1 year ago
@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 1 year ago
@FlamingPope i Love it, but Damn its alot of work :P
umpalumpa101909 1 year ago
@umpalumpa101909
Same for me
kalle1222 1 year ago
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++
TheDutchMagic 1 year ago
Comment removed
Rawhesh 1 year ago
@TheDutchMagic you need to put << endl; after that
Rawhesh 1 year ago
@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.
guyt1234 1 year ago
Does it matter if I create and compile this with Dev-C++
cuz it's givin' me errors :S
b2krobbow 1 year ago
will this compile and run in dev C++ bloodshed???
samyung77 1 year ago
@samyung77 its done in that compiler, so ye it will run!
emoismylife4evr 1 year ago
I LOVE Cplusplus!!
mcxhaste 1 year ago
Love it
kentignore 1 year ago
Will you be doing one which involves graphical output, lnes for instance ?
bertwindon 1 year ago
hello can somebody please help me i am getting error return 0; what is the problem
awais308 1 year ago
dudee, u r theee best!!!! keep up the great work!!!!! =D
haithofee 1 year ago
can you send me the codes. OR in other word the sourrce. LIke copy and paste the whole thing. Please i really need help.
awais308 1 year ago 2
sure!
haithofee 1 year ago
Why didn't you just use:
switch(cChar)
{
case 'x':
case 'X':
case '*':
// Multiplication code
break;
}
Instead of repeating code?
SaulR60 2 years ago
@SaulR60 neat trick with the switch, I never knew you could do that, I should check that out
SteveSpieldberg360 1 year ago
I tried this on dev c++ but when i wrote
case '-' : ect.. and ran the program it said '-' not within switch statement
jiggie6043 2 years ago
72,612 views That's OVER 9000!!
xboxlive6 2 years ago
omg i dont get the curly bracket thing when do u put them in? random?
farestabs 2 years ago
@farestabs yes RANDOMLY place them all over the place... and DONT consult google.. itll tell you the same thing
sodafountan 1 year ago
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 1 year ago
@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
sodafountan 1 year ago
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
farestabs 1 year ago
try using dev-c++. this compiler works on vista
jamesraylee007 2 years ago
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.
mattiexpx 2 years ago
with the IF case why do you use two equals signs before the 0 please ??????
mrconcept 2 years ago
@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).
mattiexpx 2 years ago
It show me that cin >> cDoagain; isnt good whY!?
Urketadic 2 years ago
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.
KingPinVic06 2 years ago
Break dont use a colon ( : ), it uses a semicolon ( ; )
utohaha 2 years ago
Works perfectly! Thx! It was very helpful.
xxxxxXDeadXxxxxx 2 years ago
everything worked except that the title and color wont work in visual c++ 2008
gonzalezluis78 2 years ago
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.cppCalculator"
malchiah9090 2 years ago
show me/us the sourcecode.
wiesel12345 2 years ago
@wiesel12345 i figured it out. i didnt make it a win32 empty project... i feel dumb but thanks for the concern
malchiah9090 2 years ago
desecondnumber =/= dsecondnumber
Text fail :P
ItsBarryBurton 2 years ago
it still doesnt compile :( how do i make it compile?
lillen300 2 years ago
ive done as it says and still it doesnt run :( it doesnt compile
lillen300 2 years ago
@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.
mattiexpx 2 years ago
Comment removed
lillen300 2 years ago
@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)
Dant1612 2 years ago
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.
MultiLern 2 years ago
LOL 79 errors 2 fatal warning
hehe
Spartan111792 2 years ago
tnx bro! !
ive got it just right!
ur a great help
eheheh
:)
perbys 2 years ago
dude this video was posted two years ago its not happening
athozoan 2 years ago
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
AllroundTuts 2 years ago
i think i mixed "{" "}" and "(" ")".
Can someone who succeed copy the tutorial and send it with mail to me?
Xaiaq 2 years ago
i got 14 error(s), 4 warning(s) !
Xaiaq 2 years ago
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
fireball31794 2 years ago
isn't it supposed to create an exe somewhere? it isnt for me.
OredhotchilipeppersO 2 years ago
How come I get 27 errors??! I did everything right.
iTouchedMyTouch 2 years ago
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
nshiell 2 years ago
Line 73
Calculator.cpp
`Y' (and 'y') undeclared (first use this function)..
How do I solve this? I use Dev C++
humanPleiadian 2 years ago
way does it does it show source file not compiled
HELP!!!
bubulubs 2 years ago
even after i put in the cin >> dsecondnumber; below "choose your second number" it still says its "uncleared identifier"
Thesaint411 2 years ago
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).
CrimsonEagleSG1 2 years ago
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.
0121ryanh117 2 years ago
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.
CrimsonEagleSG1 2 years ago
Im just saying, as a technicality, thats all. Really, its no reflection on your abilty.
0121ryanh117 2 years ago
any1 know a string of code that can stop the program chocking if u use a character in the interger selection?
1k1llc47s 2 years ago
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)
blackdeckbox 2 years ago
oh after the "Put in the second number" you need to put in:
cin >> dsecondnumber;
The same thing happened to me :D.
cameronbrownrox 2 years ago
lol next video after 1000 views xD
19Biohazard88 2 years ago
I cringed when I saw you add the "e" in dsecondnumber.... I was screaming at the monitor hoping you would see it, lol.
AJFreeway 2 years ago
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
3xtend 2 years ago
hes right
SloppiJ 2 years ago