Here is my code:
#include "stdafx.h"
#include <iostream>
#include <cctype>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <fstream>
using namespace std;
//function prototypes
void readString(char*, int);
void changeToUppercase(char*, int);
void displayStringInUppercase(char*, int);
//start main function
int main()
{
//variable declaration
int arraySize;
//dynamic array declaration
char* characterArray;
cout << "enter the size of dynamic array please: ";
cin >> arraySize;
characterArray = new char[arraySize];
readString(characterArray, arraySize);
changeToUppercase(characterArray, arraySize);
displayStringInUppercase(characterArray, arraySize);
delete[] characterArray;
system("pause");
return 0;
}
void readstring(char* characterArray, int arraySize)
{
cout << "enter a string of " << arraySize
<< " characters to be changed: ";
for (int i = 0; i < arraySize; i++)
cin >> characterArray[i];
}
void displayStringinUppercase(char* characterArray, int arraySize)
{
cout << "\nthe string in uppercase letter is: ";
for (int i = 0; i < arraySize; i++)
cout << characterArray[i];
cout << endl;
}
void changeToUppercase(char* characterArray, int arraySize)
{
for (int i = 0; i < arraySize; i++)
characterArray[i] = toupper(characterArray[i]);
}
i receive the the following error messages and dont know how to resolve these!!
Error LNK2019 unresolved external symbol "void __cdecl readString(char *,int)" (?readString@@YAXPADH@Z) referenced in function _main
Error LNK2019 unresolved external symbol "void __cdecl displayStringInUppercase(char *,int)" (?displayStringInUppercase@@YAXPADH@Z) referenced in function _main