Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrays, maybe... 1

Status
Not open for further replies.

ecannizzo

Programmer
Sep 19, 2000
213
0
0
US
Can someone help with my code? I'm getting error messages when I try to run it.

#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <conio.h>


void main(void)
{
char partid[7];
void inputch(char *);

inputch(partid);

}


void inputch(char pID[])
{
char ch;

printf(&quot;What is the Part ID? &quot;);

do {
ch = toupper(getch()); //uppercase user input
if (ch != '\0') { //doesn't equal null
if (isalpha(ch)) //if its a character
putch(ch); //write it to the screen
}

} while (ch != '\r'); //carraige return


}

The error messages are:

Validate.obj : error LNK2001: unresolved external symbol &quot;void __cdecl inputch(char *)&quot; (?inputch@@YAXPAD@Z)
Debug/Validate.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Thanks!
 
Just place
Code:
void inputch(char pID[]);
above the main, or create new header file for it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top