The various points below program compile time all have no problem, when debugging to the following error
Bother bosses to see what's going on, first here
thank you in advance?The main obj: error LNK2001: unresolved external symbol _print_string
The main obj: error LNK2001: unresolved external symbol _enter_string
The Debug/function. Exe: fatal error LNK1120:2 unresolved externals
An error occurred when execution link. Exe.
The source code is as follows:
#include
Void main ()
{
Extern void enter_string (char STR []);
Extern void delete_string (char STR [], char x);
Extern void print_string (char STR []);
/* the above three is to define the statement in this function you need to call other file defines the three functions of */
char c;
Char STR [80]./* the longest string can enter 80 characters */
Enter_string (STR);
Printf (" \ please enter the characters you need to remove a: ");
The scanf (" % c ", & amp; C);
Delete_string (STR, c);
Print_string (STR);
}
A second program:
#include
Void enter_string (char STR [80])
{
Gets (STR);
}
The third block
Void delete_string (char STR [], char x)
{
int i,j;
For (I=j=0; STR [I]!='\ 0'; I++)
{
If (STR [I]!=x)
{STR=STR [j++] [I];
}
}
STR [j]='\ 0';
}
The fourth block:
#include
Void print_string (char STR [])
{
Printf (" % s \ n ", STR);
}
CodePudding user response:
Put some source code in a projectCodePudding user response: