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

Link to this comment:

Share to:
see all

All Comments (368)

Sign In or Sign Up now to post a comment!
  • LOL at1:46 he says "oh jesus" 

  • does this use time to pick a random number?

  • Comment removed

  • expected `(' at end of input -- wtf is this error all about.. its anoying

  • LoL, don't typ for example .500 as a guess ^^

  • a small doubt how come you did not add <<end1<<after cout<<"enter your guess:";

  •  6 09 how does you write //

  • Can any one say me what C++ is he using??

  • I took what you taught in this video and used the random function to also  create a random amount for the highest value that the number can be like this

    int rndrndnum

    int num rndrndnum = rand()%20+1 num = rand()%rndrndnum; num = num;

  • imba 

  • LOVE YOU THANKS =DDDD

  • Comment removed

  • I'm wondering what kind of party's you go to where you guess how many gumballs there are in the jar.......Great tutorial non the less!

  • no matter what value i enter i get Too low

    iObjects = rand() % 1000 + 1;

    if(iGuess > iObjects) cout << "Too High" << endl << endl; if(iGuess < iObjects) cout << "Too Low" << endl << endl;

  • count << "Awesome, ty ;)" << endl;

  • have any1 tried going to the website he mentioned at the beginning of the tutorial? If yes could you please post the link? thanks...:)

  • @TahirAljazeera If Anybody Here Knows C++ or any other programing languages And Wants to be in a programing group inbox me on here.I Know C++ And want to start a group.its completly free.its a internet group.i got a website yall can join. Inbox me if you wanna join.plz join.My Website is A Social Site.Inbox me for details.No disrespect intended in posting this on there vids:)

  • It's

    "Too cool"~~~~~~~~~~

  • who the fuck goes to a party to guess gumballs in a jar?

  • wouldn't it be easier if you use:

    while(iUserguess != iGumballs)

  • LOLOLOLO

    my sister crashed it by entering

    81442684474271456gi

    XD

    btw i had it set from 1 to 50

    IT JSUT KEPT SAYING HER GUESS WAS TOO HIGH LIKE HTE MATRIX!

    nice tut man! epic lulz!

  • Can#t you use Else if or something instead of putting two if statements?

  • If yo're having computer problems I feel bad for you son, I got 99 problems but the comp aint one.

  • for your do while loop in the argument of the while you could have used: iUserguess != iGumballs, and that would save some time.

  • @FallofDarkness55 I agree with you. That was what I was goina say before I read your comment.

  • lol all try to put text instead of numbers and see what happens xD

  • Hello, do I need to include main(void)? can I just do main() ? Thanks in advance. I am a new learner

  • @mathlover111 no u dont need to include main(void) cause its exactly the same as main()

    it means exactly the same

  • thanks dude, ur the fucking boss!!!

  • Hey! that was soo cool! My machine just gave me a high five! thanx i never knew it could do that!..... lol

  • figured it out 

  • I'm having a problem with

    cin.clear(); C:\Users\me\learning\guessbumb­alls.cpp In function `int main()':

    13 C:\Users\me\learning\guessbumb­alls.cpp `cin' undeclared (first use this function) (Each undeclared identifier is reported only once for each function it appears in.)

    pleae help I did everything like you did unless I'm missing something

  • @brokenhorseshoe resolve the namespace you need using the scope resolution operator. eg

    std::cin

    std::cout

  • how u put in this .... Symboll just after rand

  • Mine just keeps spamming too high?? any ideas

  • @CMD1994VBS something wrong inside ur loop

  • wow you could make a very complex 20 questions game that guesses what you are thinking about

  • lololololololol i typed no instead of a number and kept scrolling with too high down the whole thing.

  • yea im a programmer and i wish i watched this when i was in school

  • this looks kinda hard

    

  • that's interesting.

  • of everything in my code their is something wrong with my return 0;... duh hell???

  • @jacksonjboy17

    check the line before return 0 check if there is a Semi Colon to declare an end of statement.

  • Good tutorial, it worked, thnxs !

  • straight out canadian.

  • hi, i use Visual Studio 2008 Express Edition.

    but everytime I try to use ´time´ it comes with this error:" error C3861: 'time': identifier not found."

    please help me.

  • @MakiFreak12

    ...i use dev C++ hell of alot easier

  • error: 'srand' was not declared in this scope.... Do you HAVE to be using Dev C++?

  • @lzrd0113 Well, I got it to work now, but after continuing to the rest of your tutorials and I just decided to include the windows.h library and then srand worked... I don't know why, but including that works for me. I removed it, and, again, the same error message.

  • iGumballs = rand()%1000+1;

    the symbol is the percentage symbol, copy and paste (it will look differently when its in the compiler)

  • @13379009 agreed.

    On another note, I don't really understand what the static cast unsigned thing does. Anyone care to explain?

  • neat!

  • Nice canadian accent ^^ spotted it a mile away

  • Really good program, thank you so much!

  • type in a word lol

  • how come my text dont turn blue like on his screen?

  • ben is that you? O_O

  • why doesnt any of your shit ever work for me?

  • it would be easier to write

    while(iUserguess != iGumballs);

  • lol i guessed mine in 1 try

  • @Marc4440 Virtual high five! XD

  • dude how do u hv #include blue????

    and why?

  • @Xkiller6000X the color of #include depends on what C++ compiler your using and the reason why you have #include is #include is a preprocessor directive which means before the compiler executes any code you wrote the #include statement tells it to include which library your using for example

  • Nice program!

  • I have followed EXACTLY what he has done, and I have checked OVER AND OVER again to make sure I did it right yet I come up with these errors:

    error C2059:syntax error :{

    error 2143 syntax error missing ; before {

    error C2059 syntax error :)

    fatal error C1075 end of file found before the left brace { (program source) was matched

    I am using the same C++ hes using, with win XP, and with a clone of what he wrote down, some one tell me what happend.

    P.S. the syntax errors happen at while command

  • @undead890 Best C++ error ever.

    syntax error :)

    LMAO

  • OMG!!!! I am using Dev-C++ and it wont compile the code. I'm using vista, is that the problem? And its also saying I have errors in lines of the code that I KNOW is right. Please help

  • is it blank? when you go execute cmopile? can you no tsee anything? then you have to go program reset. And if it still shows errors when you know that their not just run the exe. Hope this helped and subscribe to me.

  • @ICauseMouthCancer check for capitalization errors or errors before the statement highlighted. If there are still no errors make sure you have your {} brackets and everything else the same. I get that problem alot and don't find out the problem until i look at it for so long.

  • is it me or is it blurry? i will go blind staring at this.

  • Howcome when I go to debug in Visual Studio, it's grayed out and I can't click on it?

  • have you created a new project yet? that might be a problem...

  • Worked like a charm.

    Thank you once again for the sweet tutorial!

  • Yeej, 50! haha

  • When i finished it it says no such of file or ditectory..

  • Haha, this is fantastic.

    Simple, but so great to learn on!

    Thanks!!!

  • Wow this is great!!... nice program. I'm amazed at how this works

  • @DreHectik u right

  • lol now ive made this game in batch, python and C++ now :D

  • Nice One!! I made it my number was 969 ;D

  • i still cant compile it...

  • whats the sign you put in the line:

    igumballs = rand( )

    Its really unclear and I cant recognize it at all.

    Thanks

  • @Friedtunafish77 it is a % symbol or PERCENT it looks different in the program, hope i helped.

  • Yes, you helped me a lot. Thanks. Your kindness overwhelmed me.

  • At least compared to others being "reasonable"

  • I'm trying to use Visual C++ and i'm getting an error:

    Did you forget to add '#include "stdafx.h"' to your source?

    I can't write the code without the "stdafx.h"!

    Then I tried to compile with the pre compile and the file is with 10kb, just I can execute the file!!

    What can I do?

  • make sure when you start the project to check the "empty project "check box

  • select Win32 Console Application under New - Project

  • @ERosostolato Ive been getting that too...

  • what text editor are you using?

  • if u want better quality for the vid go to the adress bar and add "&fmt=18"

    no quotes.

  • thnx =D

  • You do the exact same thing. Stop complaining at others work. I mean. "look at my channel" is enough.

  • didnt work for me

  • what do you mean module or whatever you call it at 3:14 where it says: iGumballs = rand()

    i dont get what to put after the ()

  • I think its the percentage sign

  • iGumballs = rand()%1000+1;

    And that's to put a random number, between 1000 and 1, as the iGumballs value..

  • the freaking website wont work

  • how do i get that imudguless?

  • for efficiency, shouldn't you use "else if" rather than "if" for the "if(iUserguess < iGumballs)" element? my apologies if I'm wrong.

  • It doesn't matter, you'd only be writing more code ;)

  • What program do you use

    I am using Dev and all of the colors i want you have. For code identification.

  • MrPsycho3D - looks to me as if he's using Visual C++ Express.

  • lol.cpp:5: error: expected `;' before "int"

    lol.cpp: In function `int main()':

    lol.cpp:9: error: expected initializer before "int"

    lol.cpp:15: error: `iGuesses' was not declared in this scope

    lol.cpp:21: error: `iUserguess' was not declared in this scope

    lol.cpp:31: error: expected primary-expression before ')' token

    lol.cpp:31: error: expected `;' before ')' token

    lol.cpp:36: error: expected `}' at end of input

  • I thought Int main(void) caused memory corruption?

  • did youtube make some code on their pages so cursor disappear if u do not move mouse for some period of time or is it some bug on my browser?

  • ok thanks...

  • where can i download C++?

    what site?

  • omg... c++ is a programming language. If you need a c++ complier: GOOGLE GOOGLE GOOGLE GOOGLE GOOGLE GOOGLE GOOGLE

  • just to get some ideas for compilers to download

    dev c++

    code::blocks

    visual c++ express

    borland c++ builder ( not recommended though)

  • Do you really need cin.clear()?

  • Comment removed

  • what is the symbol you are using for "OR" on your while lines

  • Dude great tutorial. but may i suggest you put the code of the program into the description so that we can just coppy and paste your code and pay attention to what you have to say and not just spend the entire time trying to write down what you've got. other then that it's a great tutorial.

  • Comment removed

  • hey man ur a good tutor at this! keep it up man ur great! im a beginner and at first was using ur videos and then taking the codes apart to find out what everything does and than i started making my own programs but i came back to your video today and it was great! if u wanna talk bout programming or coding or stuff like that thatd be cool. im not very good but im learning!

  • Great tutorial! Thanks so much

  • Comment removed

  • Comment removed

  • Comment removed

  • if(iUserguess > 1Gumballs) youre problem is at 1Gunballs, is iGunballs not 1gunbals and you have to leave 1 space so i should be like this

    if(iUserguess > iGunballs)

  • this is an error i get:

    if(iUserguess > 1Gumballs)

    that not invalid...

    how i must do it...???

  • thank you so much, i found it's a so interesting thing!!

  • Instead of what you put in the while for the do statement, i put this:

    while(iuserguess != igumballs)

    and it still works

  • Um... Yea, I don't know who voted negatively to Sherpaswami's comment but I agree, you're going a little too fast. Also video tutorial 2 has been removed. But nonetheless great video and really helpful albeit a little fast =).

  • u know u can pause it....to catch up...?

  • it says i have an error on iGuesses = 0;

    using DEV C++

    any ideas on whats wrong?

  • I'm using the same software, it works for me. Make sure you typed everything correctly and that there is a semi-colon on the line above

  • what is the or sign he uses. does it matter if you put or or do you have to do it his way

  • it is the percent sign; %

  • wat is a modulus sign.... ??

  • Percent sign (%)

  • this doesnt work for dev-c++ it had loads of errors and one about the

    "#isostream thingy

  • I had the same mistake.

    It's not isostream, its iostream, you put an s in between the i and the o.

  • oooooooh!!! yh! it works now!

  • I got it to work it helps if you turn it to High Def then you can see everything. Good Luck!

  • I have a question; underneath system("CLS"), where there is a cin command: "cin.clear", it is a curly bracket, but is it a regular bracket next to that? Watch from 1:57.

  • No just parentheses cin.clear()

  • what means error before token..............????

    please help me I'am confused it's keep telling me on part where I tiped, just like this system("CLS"); and yes i have DeV-C++. Please help me and P.S. i love your videos they realy helped me...

  • int main(void) is not necessary in C++...

  • yes it is, you must have a main function in your program.

  • You are out of league dude, I am talking about void argument passed to the main function, it is not necessary in C++.

  • true, also you could call it void main()

    and leave out the return statement because you don't need to return a value:)

    ow, and you can put the integers decalarations short by just using

    int iA,iA,iC;

    in stead of seperate lines:)

  • Yeah I don't know why he uses void *shrugs*

  • Now make a program that automatically finds the random number lol :P

    I think that would actually look something like this

    {

    int answer = 1;

    do { answer++ }

    while(answer != iGumballs);

    if(answer == iGumballs) cout << "The Answer Is " << answer;

    }

    of course you would have to place that code in the game somewhere where it is not going to cause an error... :D

  • Dont criticise someone who is doing something to help people, for FREE. Somewhat better than you probly do, He tried keeping it basic for ppl like me who have no clue how to code in c++ but would like too.

  • I didnt criticize anyone you idiot.

  • i got a problem though, when i start the game everything is fine but when i enter i guess ihave to enter it twice for it to "register"

  • all of your tutorials are magnificant

  • Nice tutorials!

  • whats Modgules

  • its called modulus (%)

    It take the rest of a division

    5/2 = 2 rest 1 so

    5%2 = 1

  • it says that mine is to buggy...but i did exactly what you did.

    one of them is when i put "con.clear();"

    could you or anyone else help thanks

  • cin.clear

  • sorry i confused you...thanks for helping, i meant to say that i put

    cin.clear();

  • Help!, something is wrong... It says: No such file or directory. help me...

    Thanks

  • oh i just found out it was lol Visual C++ you dont have to buy it you could just change the date back and it will work =D

  • Looking for c++ friends

  • What program are you using now, i thought it was Dev-C++?

  • Man that read like one pass assembler. Give us a CLASS

  • C++ Beginner Programming Tutorial, teaches you how to create a guessing game, click on my username to see the video!

  • while building

    the problem is:

    1>c:\users\parents\main\main\m­ain.cpp(6) : error C2447: '{' : missing function header (old-style formal list?)

  • did you type in int main (void)?

  • yes but...(void) is a...function unable or something

  • to clear some things up void is now obselete and is bad practive to write it so please disregard

    this int main(void)

    do this int main()

  • What is he writingat 7:05 - 7:10?

  • "iGumballs" undeclared identifier

    help

  • write at the start of the program int iGumballs and it will work ...

  • how the f*** do you know when to put ";" ?!?!?

  • you put a semi colon at the end of every statement.

  • lmao not that hard n00b

  • how old are you? like 12?

  • how the fuck does he sound 12???