Using the square below the main() function, write the code for a user-written function called larger which will compare two integers sent to it to determine which is larger and print (to the screen or console) a message indicating which is larger. I get errors when I debig it. How do I fix it.
1 2 3 4 5 6 7 8 9 10 11 12
|
#include <stdio.h>
void larger(int x, int y);
int main()
{
int grade1, grade2;
printf("n\nEnter two numeric grades between 0 and 100: ");
scanf( "%d%d ", &grade1, &grade2);
larger(grade1, grade2);
return(0);
}
|
The errors:
1>------ Build started: Project: Chapter5, Configuration: Debug Win32 ------
1>Compiling...
1>Chapter5.cpp
1>c:\users\jennifer\documents\visual studio 2008\projects\chapter5\chapter5\chapter5.cpp(8) : warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> c:\program files (x86)\microsoft visual studio 9.0\vc\include\stdio.h(306) : see declaration of 'scanf'
1>Linking...
1>Chapter5.obj : error LNK2019: unresolved external symbol "void __cdecl larger(int,int)" (?larger@@YAXHH@Z) referenced in function _main
1>C:\Users\Jennifer\Documents\Visual Studio 2008\Projects\Chapter5\Debug\Chapter5.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Jennifer\Documents\Visual Studio 2008\Projects\Chapter5\Chapter5\Debug\BuildLog.htm"
1>Chapter5 - 2 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========