C++ errors… sorry if its always me the one struggling here for help:/?

the ultimate system:P

#include
employing namespace an std;

useless makeNegative(int);

int main()

//int array5=1, A COUPLE OF, 3, 4, 5;

//if (array! = &array0)
//cout << "True" << endl;
//else
// cout << "False" << endl;

int val=0;
int *ptr;
ptr=&val;

cout << "Enter lots " << endl;
cin >> val;
makeNegative(val);

cout << " Your number is actually:" << val;

system(“pause”);
returning 0;

useless makeNegative(int *val)

in the event (*val > 0)
*val = -(*val);

blunders:(1)
1>10 9.obj:error LNK2019:unsure external symbol “void __cdecl makeNegative(int)” (makeNegativeYAXHZ) referenced throughout function _main
(2)
1>C:\Documents in addition to Settings\HP_Administrator\My Documents\Visual Studio 2008\Projects\10.9\Debug\10.9.exe:deadly error LNK1120:ONE PARTICULAR unresolved externals

#include
employing namespace an std;

useless makeNegative(int *val); // <–added "*val here

int main()

//int array5=1, A COUPLE OF, 3, 4, 5;

//if (array! = &array0)
//cout << "True" << endl;
//else
// cout << "False" << endl;

int val=0;
int *ptr;
ptr=&val;

cout << "Enter lots " << endl;
cin >> val;
makeNegative(&val); // <– additional an " & "here

cout << " Your number is actually:" << val<<endl;

system(“pause”);
returning 0;

useless makeNegative(int *val)

in the event (*val > 0)
*val = -(*val);

A function’s prototype and its real definition have to have exactly identical signature.Which is, the gain type, name, and parameters must be precisely the same.

Website, your makeNegative() function’s prototype would not match the definition.The prototype says who’s takes a good int as being a parameter, however the definition takes an int* (i.e., a suggestion to an int) on the other hand.

Leave a Reply