עזרה בc++ אולי אתם תדעו
כתבתי קטע מתוכנית והקומפיילר לא זהה בעיות וכשהרצתי הוא עשה צרות (מפורט למטה): #include <iostream.h> #include <fstream.h> //for the input and output files #include <stdlib.h> //for rand #include <time.h> //for srand(time); #include <iomanip.h> //for setw(); //******************************************************************************************* //********************** GLOBALS ************* //******************************************************************************************* //**************************************************************** //******************* FUNCTIONS - DECLARATIONS ******************* void GetData (char cInputString, ifstream &input);//reads the contents of the file and inserts it //into a string //***************************************************************** //*************************** STARTING **************************** int main() //the main part of the program { ifstream input; //for reading ofstream output; //for writing input.open("input.txt",ios::in);//open for reading output.open("output.txt",ios:
ut); //open for writing char cInputString[1421]=" "; //for the input if(!input) //if the "open" didn't work { exit(0); //stop everything!!! }//end of if else { GetData (cInputString[1421],input); } input.close(); //close-reading output.close(); //close-writing return 0; }//end of main //***************************************************************** //*************************** FUNCTIONS *************************** //******************FUNCTION GET DATA**************************** // reads the contents of the file and inserts it into a string * //*************************************************************** void GetData (char cInputString[1421], ifstream &input) { int iPlace=0; //for the place in the string while (!input.eof()) //runs until the end of the input { input.get(cInputString[iPlace]); //inserts chars into the string iPlace=iPlace+1; } }//end of GetData ההערה: -------------------Configuration: third13 - Win32 Debug-------------------- Linking... third13.obj : error LNK2001: unresolved external symbol "void __cdecl GetData(char,class ifstream &)" (?GetData@@YAXDAAVifstream@@@Z) Debug/third13.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. third13.exe - 2 error(s), 0 warning(s) מה לעשות? תודה!!
כתבתי קטע מתוכנית והקומפיילר לא זהה בעיות וכשהרצתי הוא עשה צרות (מפורט למטה): #include <iostream.h> #include <fstream.h> //for the input and output files #include <stdlib.h> //for rand #include <time.h> //for srand(time); #include <iomanip.h> //for setw(); //******************************************************************************************* //********************** GLOBALS ************* //******************************************************************************************* //**************************************************************** //******************* FUNCTIONS - DECLARATIONS ******************* void GetData (char cInputString, ifstream &input);//reads the contents of the file and inserts it //into a string //***************************************************************** //*************************** STARTING **************************** int main() //the main part of the program { ifstream input; //for reading ofstream output; //for writing input.open("input.txt",ios::in);//open for reading output.open("output.txt",ios: