Advertisement

AddIt() function

Started by February 02, 2002 09:06 PM
10 comments, last by killadude 22 years, 10 months ago
does the AddIt() function work with vc++6? cuz im getting errors, with it. SKATEBOARDING IS NOT A CRIME!
SKATEBOARDING IS NOT A CRIME!
Never heard about that function.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
I think you just made it up;
maybe its a function he found in a tutorial. In that case, killadude, you have to define it first.

"I''ve learned something today: It doesn''t matter if you''re white, or if you''re black...the only color that REALLY matters is green"
-Peter Griffin
"I've learned something today: It doesn't matter if you're white, or if you're black...the only color that really matters is green"-Peter Griffin
in my book "teach yourself c++ in 21 days"
it uses addit like this
#include <iostream.h>

void main()
{
int iNum1;
int iNum2;
int iResult;

iResult = AddIt(iNum1, iNum2)

cout<<"The result is: \n";
cout<< iResult;
cout<<"\n";
}

SKATEBOARDING IS NOT A CRIME!
SKATEBOARDING IS NOT A CRIME!
Result = Num1 + Num2;
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
thanks fruny- but i already know that, i was just askin if that function really worked or was it just lack of knowlege of the author of the book, but thanks for your post

SKATEBOARDING IS NOT A CRIME!
SKATEBOARDING IS NOT A CRIME!
Advertisement
Frankly, I don''t trust those "learn in days" books. I find it''s more of a gimic to sell the book, and any book that needs a gimicky name is a suspicious one (see also Books for Dummies).

"I''''m not evil... I just use the power of good in evil ways."
To answer your question, no, it's not a function. The author probably defined it somewhere in a previous chapter.

if for some reason it is an oversight (if it is i would put down the book and look elsewhere to learn c++ =) ) it's probably defined like this:

    #include <iostream.h>int AddIt(int num1, int num2){    return num1 + num2;}void main(){    int iNum1;    int iNum2;    int iResult;    iResult = AddIt(iNum1, iNum2)    cout<<"The result is: \n";    cout<< iResult;    cout<<"\n";}     



Edited by - AbsolutDew on February 5, 2002 3:13:51 AM
quote: Original post by Tac-Tics
Frankly, I don''t trust those "learn in days" books. I find it''s more of a gimic to sell the book, and any book that needs a gimicky name is a suspicious one (see also Books for Dummies).


"optimised ultra sparc assembly for dummies"


Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage
Well, it most certainly must be a function (or a function-like macro), otherwise any source file referencing it wouldn''t compile without at least a warning. But, of course it''s not a standard function.

This topic is closed to new replies.

Advertisement