60 Posted Topics

Member Avatar for ksri

@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 …

Member Avatar for Ancient Dragon
0
162
Member Avatar for eddy518

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 …

Member Avatar for ChaseVoid
0
133
Member Avatar for eddy518

[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 …

Member Avatar for twomers
0
303
Member Avatar for kamlesh_ag07

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 …

Member Avatar for ChaseVoid
0
98
Member Avatar for Lost in Code...

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 …

Member Avatar for ChaseVoid
0
121
Member Avatar for cowboys111

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.

Member Avatar for ChaseVoid
0
105
Member Avatar for pointers

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 …

Member Avatar for ChaseVoid
0
150
Member Avatar for conan19870619

WOW! your so cool Narue.. kekeke.. Interesting answers, though I had no idea what any of the question meant.. sorry for posting here.. lol

Member Avatar for conan19870619
0
136
Member Avatar for pprabhakar

>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. ^_^.

Member Avatar for Narue
0
107
Member Avatar for koolboy

[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 …

Member Avatar for ChaseVoid
0
196