60 Posted Topics
Re: @narue Wow, that's a nice explaining there. Which compiler do you use? While, we are here asking about functions, can I ask which would a replacement for [inlinecode]getch();[/inlinecode] for C. I have read through some of the threads here, stating that it's an compiler extension. What code should we put … | |
Re: First, I'm not understanding why are you all being so weird here. There totally no of [B]TOTAL[/B] Just refer to your code. [code] display_output(num1, num2, num3, sum); [/code] [code] void display_output(int& a, int& b, int& c, int& result) [/code] And you might wanna declare result as integer too. That is … | |
Re: [code] double get_diagonal (int& length, int& width) { return sqrt((length * length) + (width * width)) / 12.0; }[/code] I tried executing the program with the corrections mentioned above, but it showed up with this error Error 1 error C2668: 'sqrt' : ambiguous call to overloaded function c:\users\chasevoid\documents\visual studio 2008\projects\c++\squarecheck\squarecheck\squarecheck.cpp … | |
Re: Well if you Google "namespace in C++" you'll get a lot of information about it. However, namespace is a collection of classes. to get a proper output you have to use that. By using [inlinecode]using namespace std;[/inlinecode] you remove the use of using std in all of the other places … | |
Re: The following code will help you create the situation you needed to perform. [code] for(tries=0; tries>=5; tries++) { char y = 'y'; printf("Do yo wanna continue? (y/n) \n"); scanf("%d", &y); } if (tries >=5) { printf("Too many tries, you lose!!!\n"); } [/code] You might also want to include some error … | |
Re: Well you code has errors since, you are declaring circle() and rectangle() with the return type integer, so you must specify a return inside it. or you can just declare them as void. | |
Re: Your enum declaration is wrong; [code] enum Color { red, blue, black, green }; [/code] You need to have a semicolon [;] at the end of it's declaration. Also, only enter Digits at the question prompt, because then the string is converted into integer. So anything other an integer will … | |
Re: WOW! your so cool Narue.. kekeke.. Interesting answers, though I had no idea what any of the question meant.. sorry for posting here.. lol | |
Re: >Google came up with this as the first hit xD I also got the same thing. I had no idea that function pointers existed. Cool~ Now I gotta try out some programs using this. ^_^. | |
Re: [code]for ( int i = 1; i < limit; i++ ) sum += i;[/code] In the above code you might wanna change it to [code]for ( int i = 1; i <= limit; i++ ) sum += i;[/code] Though it's not much of problem -_- cause you mentioned it was … |