I receive 2 errors, neither of which tell me which line the error occurred:
Code:
Error 2 fatal error LNK1120: 1 unresolved externals
Error 1 error LNK2019: unresolved external symbol _output referenced in function _main blah.obj
Since i am unsure of where or why these errors occur, my program is:
Code:
#include <stdio.h>
void main()
{
/* array for shifting an uppercase letter */
int x[] = {3, -1, 0, 2, -2};
/* tarray for shifting a lowercase letter */
int y[] = {2, 4, -1, -2};
/* array for shifting a digit */
int z[] = {1, -1, 2};
int *xNext = x;
int *yNext = y;
int *zNext = z;
FILE *fp1, *fp2; // file pointers
const int xArraySize = 5;
const int yArraySize = 4;
const int zArraySize = 3;
int totalChars = 0;
int iter = 0;
char inputTextArray[5000];
char inputFilename[30]; // Character Array to hold the users specified input file name
char currentCharacter; //current character input from the file
char outputFilename[30]; // holds the users specified output file name
char *textArrayPointer = inputTextArray;
printf("Enter the name of the file to be scanned: ");
scanf("%s", inputFilename); // Scans the input file specified by the user
fp1 = fopen(inputFilename, "r"); // open the file as read-only
printf("Enter the name of the file you wish to copy %s to: ", inputFilename); // ask user for outputFilename (copy of inputFilename)
scanf("%s", outputFilename);
fp2 = fopen(outputFilename, "w"); // open output file, write-only
while((currentCharacter = getc(fp1)) != EOF)
{
*textArrayPointer = currentCharacter;
textArrayPointer++;
}
while(*textArrayPointer != '\0')
{
/* Check for capital letters A through Z
A in ASCII is 65, and Z is 90 */
if (( *textArrayPointer >= 65 ) && ( *textArrayPointer <= 90 ))
{
iter = totalChars % xArraySize;
while(iter-- != 0)
{
xNext++;
}
*textArrayPointer = *textArrayPointer + *xNext;
if ( *textArrayPointer < 65)
{
*textArrayPointer += 26;
}
if ( *textArrayPointer > 90)
{
*textArrayPointer -= 26;
}
putc(inputTextArray, output(&fp2));
}
/* Check for lower case letters a through z
a in ASCII is 97, and z is 122 */
else if (( *textArrayPointer >= 97 ) && ( *textArrayPointer <= 122 ))
{
iter = totalChars % yArraySize;
while(iter-- != 0)
yNext++;
*textArrayPointer = *textArrayPointer + *yNext;
if ( *textArrayPointer < 97)
{
*textArrayPointer += 26;
}
if ( *textArrayPointer > 122)
{
*textArrayPointer -= 26;
}
putc(inputTextArray, output(&fp2));
}
/* Check for numbers 0 through 9
0 in ASCII is 48, and 9 is 57 */
else if (( *textArrayPointer >= 48 ) && ( *textArrayPointer <= 57 ))
{
iter = totalChars % zArraySize;
while(iter-- != 0)
zNext++;
*textArrayPointer = *textArrayPointer + *zNext;
if ( *textArrayPointer < 48)
{
*textArrayPointer += 26;
}
if ( *textArrayPointer > 57)
{
*textArrayPointer -= 26;
}
putc(inputTextArray, output(&fp2));
}
/* The criteria did not meet the previous
conditions. The character must be a symbol */
else
{
putc(inputTextArray, output(&fp2));
}
*textArrayPointer++;
totalChars++;
}
}
What can i do to get rid of these errors?